Hi,
I can't get the android tier 2 template to run on my device. I followed the steps from this guide
https://www.appgamekit.com/documentation/guides/25_android.htm. I get to the point that Android Studio compiles the APK without errors but when I try to run it on my old device (api 17) or on a newer virtual device (api 26) it crashes at startup: AKT Template has stopped
This is what the logcat is saying:
06-05 09:30:32.897 21214-21214/com.mycompany.mytemplate E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mycompany.mytemplate/com.thegamecreators.agk_player.AGKActivity}: java.lang.IllegalArgumentException: Unable to load native library: /data/app-lib/com.mycompany.mytemplate-1/libandroid_player.so
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2463)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2520)
at android.app.ActivityThread.access$600(ActivityThread.java:162)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1366)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:5751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1083)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:850)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: Unable to load native library: /data/app-lib/com.mycompany.mytemplate-1/libandroid_player.so
at android.app.NativeActivity.onCreate(NativeActivity.java:193)
at com.thegamecreators.agk_player.AGKActivity.onCreate(AGKActivity.java:30)
at android.app.Activity.performCreate(Activity.java:5165)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1103)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2419)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2520)
at android.app.ActivityThread.access$600(ActivityThread.java:162)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1366)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:5751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1083)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:850)
at dalvik.system.NativeStart.main(Native Method)
06-05 09:31:02.782 21214-21230/com.mycompany.mytemplate E/FirebaseInstanceId: Token retrieval failed: SERVICE_NOT_AVAILABLE
So it looks like the issue is with the libandroid_player.so file. I did ran the jniCompile.bat succesfully by the way. The log shows 2 warnings:
jni/Core.cpp:673:22: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
agk::JoystickAxis( (void*)id, stick, axis, value );
^
jni/Core.cpp:678:24: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
agk::JoystickButton( (void*)id, button, state );
^
2 warnings generated.
Anyone ran into this too?
Anyone know a way to solve it?