Failed to verify Onesignal after Android export

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By angeltrev

So I was trying to update my godot engine from 3.2.3 to 3.3.4, after fixing a lot of issues on updating we have mostly solve everything except for this error:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.jonajo.jurokumusashi, PID: 4755
java.lang.VerifyError: Verifier rejected class com.jonajo.onesignal.onesignal: void com.jonajo.onesignal.onesignal.<init>(org.godotengine.godot.Godot) failed to verify: void com.jonajo.onesignal.onesignal.<init>(org.godotengine.godot.Godot): [0x6] register v2 has type Reference: org.godotengine.godot.Godot but expected Reference: android.app.Activity (declaration of 'com.jonajo.onesignal.onesignal' appears in /data/app/com.jonajo.jurokumusashi-5Scs_y_UhzHlu0lRKhXKTQ==/base.apk)
    at java.lang.Class.classForName(Native Method)
    at java.lang.Class.forName(Class.java:453)
    at java.lang.Class.forName(Class.java:378)
    at org.godotengine.godot.plugin.GodotPluginRegistry.loadPlugins(GodotPluginRegistry.java:141)
    at org.godotengine.godot.plugin.GodotPluginRegistry.<init>(GodotPluginRegistry.java:63)
    at org.godotengine.godot.plugin.GodotPluginRegistry.initializePluginRegistry(GodotPluginRegistry.java:95)
    at org.godotengine.godot.Godot.onCreate(Godot.java:640)
    at androidx.fragment.app.Fragment.performCreate(Fragment.java:2414)
    at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1418)
    at androidx.fragment.app.FragmentTransition.addToFirstInLastOut(FragmentTransition.java:1195)
    at androidx.fragment.app.FragmentTransition.calculateFragments(FragmentTransition.java:1078)
    at androidx.fragment.app.FragmentTransition.startTransitions(FragmentTransition.java:117)
    at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2408)
    at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
    at androidx.fragment.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:2243)
    at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:654)
    at org.godotengine.godot.FullScreenGodotApp.onCreate(FullScreenGodotApp.java:62)
    at com.godot.game.GodotApp.onCreate(GodotApp.java:46)
    at android.app.Activity.performCreate(Activity.java:7023)
    at android.app.Activity.performCreate(Activity.java:7014)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2758)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2883)
    at android.app.ActivityThread.-wrap11(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1613)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6523)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)

On the 3.2.3 version it works fine, and the app doesn’t crash if we have the onesignal plugin enable. Not sure if the plugin was updated or what, I couldn’t find much information about it. Has anyone dealt with this issue?

Edit: This only happens on startup of our app when we export the app with the onesignal plugin enable.

:bust_in_silhouette: Reply From: angeltrev

So I had to update the godot-lib used on my plugin and inside the code of my plugin i had to change this line:

activity = godot;

to

activity = godot.getActivity();