godot: Production crashes with GodotPayments on Android
Godot version: 3.2.1
OS/device including version: Android devices
Issue description: We released a game using the godot engine last week and our users experience a lot of crashes, which get reported in the google play interface:
java.lang.NullPointerException: at
org.godotengine.godot.GodotPaymentV3.setAutoConsume (GodotPaymentV3.java:180) at
org.godotengine.godot.GodotLib.step (Native Method) at org.godotengine.godot.GodotRenderer.onDrawFrame (GodotRenderer.java:51) at
android.opengl.GLSurfaceView$GLThread.guardedRun (GLSurfaceView.java:1573) at
android.opengl.GLSurfaceView$GLThread.run (GLSurfaceView.java:1272)
I wasn’t able to reproduce this issue myself yet and sadly have no other infos. From the reviews it doesn’t get clear when the crashes are occurring.
Here the code part where the setAutoConsume function is called:
func _ready():
pause_mode = PAUSE_MODE_PROCESS
# check for android
if Engine.has_singleton("GodotPayments"):
payment = Engine.get_singleton("GodotPayments")
currentMode = modes.Android
payment.setAutoConsume(false)
print("Using Android IAP")
I implemented an
if payment: check before calling setAutoConsume, but why is null anyway?
I also have a lot of crashes with this log:
java.lang.NullPointerException:
at org.godotengine.godot.GodotPaymentV3.<init> (GodotPaymentV3.java:71)
at org.godotengine.godot.GodotPaymentV3.initialize (GodotPaymentV3.java:63)
at org.godotengine.godot.GodotLib.setup (Native Method)
at org.godotengine.godot.Godot$2.run (Godot.java:325)
at android.opengl.GLSurfaceView$GLThread.guardedRun (GLSurfaceView.java:1502)
at android.opengl.GLSurfaceView$GLThread.run (GLSurfaceView.java:1272)
There is no init function I’m calling in the code, so I can’t implement a check there
Thanks for your support, Tobias La
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (17 by maintainers)
See #38749 - my understanding is that the new name for the singleton is
GodotPayment(without s), and it’s the same name for the plugin.In 3.2.1 and earlier, the module was
org/godotengine/godot/GodotPaymentV3and the singleton wasGodotPayments(with an s).