GameAnalytics / GA-SDK-GODOT

Official GameAnalytics Godot SDK repository
MIT License
42 stars 7 forks source link

java.lang.VerifyError crash on Android app startup when using Android plugin in 3.2.4-rc2 #11

Closed msoechting closed 3 years ago

msoechting commented 3 years ago

With Godot 3.2.4 apparently the way the Godot activity is retrieved has changed, leading to a crash on startup when using the GameAnalytics SDK in an Android build:

02-13 23:07:07.393  4669  4669 E AndroidRuntime: FATAL EXCEPTION: main
02-13 23:07:07.393  4669  4669 E AndroidRuntime: Process: com.gameanalytics.godottest, PID: 4669
02-13 23:07:07.393  4669  4669 E AndroidRuntime: java.lang.VerifyError: Verifier rejected class com.gameanalytics.godotgameanalytics.GodotGameAnalytics: void com.gameanalytics.godotgameanalytics.GodotGameAnalytics.init(java.lang.String, java.lang.String) failed to verify: void com.gameanalytics.godotgameanalytics.GodotGameAnalytics.init(java.lang.String, java.lang.String): [0x7] register v0 has type Reference: org.godotengine.godot.Godot but expected Reference: android.app.Activity (declaration of 'com.gameanalytics.godotgameanalytics.GodotGameAnalytics' appears in /data/app/com.gameanalytics.godottest-mtZ_tK2kr4ox-nPt89PH7A==/base.apk)

This can be reproduced using the example project and Godot 3.2.4-rc2. I think the fix is related to this comment.

It would be great if you could update the plugin source code and provide a compatible 3.2.4 plugin build on the download page. Thank you!

the1schwartz commented 3 years ago

Once 3.2.4 is out of release candidate we will make an update

Mr-1311 commented 3 years ago

Godot 3.3 stable is released now, and I'm getting the same error:

 java.lang.VerifyError: Verifier rejected class com.gameanalytics.godotgameanalytics.GodotGameAnalytics: void com.gameanalytics.godotgameanalytics.GodotGameAnalytics.<init>(org.godotengine.godot.Godot) failed to verify: void com.gameanalytics.godotgameanalytics.GodotGameAnalytics.<init>(org.godotengine.godot.Godot): [0x6] register v2 has type Reference: org.godotengine.godot.Godot but expected Reference: android.app.Activity (declaration of 'com.gameanalytics.godotgameanalytics.GodotGameAnalytics' appears in /data/app/~~ipgrBL3J5xtpPKkoOyqrww==/com.the1311.astrorbit-i6BkxOMgFSFYIiw1fCsGfw==/base.apk!classes2.dex)

AdMob plugin updated their plugin to 3.3 on this commit. Can you update this plugin too please? Thanks.

the1schwartz commented 3 years ago

This has been fixed in the latest version now (v1.2.8)