yasirkula / UnityIonicIntegration

A guide to integrating Unity 3D content into an Ionic app and sending messages between them (for Android & iOS)(tested with Vuforia plugin)
104 stars 32 forks source link

App crashing on startup #71

Closed linkedoranean closed 3 years ago

linkedoranean commented 3 years ago

Hi!

I'm trying to install the plugin and followed all instructions. But every time I try to run the project, the app crashes.

Here is the logcat:

2021-04-05 18:00:24.326 19725-19725/? I/o.ionic.starte: Late-enabling -Xcheck:jni 2021-04-05 18:00:24.785 19725-19725/io.ionic.starter W/o.ionic.starte: miui_dex2oat: oat file of /data/app/io.ionic.starter-MdzXuzyIos8PRDy0zgPnxw==/base.apk is not exists 2021-04-05 18:00:24.844 19725-19725/io.ionic.starter I/Perf: Connecting to perf service. 2021-04-05 18:00:24.948 19725-19725/io.ionic.starter E/o.ionic.starte: Invalid ID 0x00000000. 2021-04-05 18:00:24.948 19725-19725/io.ionic.starter D/AndroidRuntime: Shutting down VM 2021-04-05 18:00:24.953 19725-19725/io.ionic.starter E/AndroidRuntime: FATAL EXCEPTION: main Process: io.ionic.starter, PID: 19725 java.lang.RuntimeException: Unable to start activity ComponentInfo{io.ionic.starter/com.unity3d.player.UnityPlayerActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x0 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2984) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3119) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1839) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:201) at android.app.ActivityThread.main(ActivityThread.java:6864) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873) Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0 at android.content.res.Resources.getText(Resources.java:360) at android.content.res.MiuiResources.getText(MiuiResources.java:97) at android.content.res.Resources.getString(Resources.java:453) at com.unity3d.player.UnityPlayer.GetGlViewContentDescription(Unknown Source:20) at com.unity3d.player.UnityPlayer.<init>(Unknown Source:256) at com.unity3d.player.UnityPlayerActivity.onCreate(UnityPlayerActivity.java:41) at android.app.Activity.performCreate(Activity.java:7232) at android.app.Activity.performCreate(Activity.java:7221) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2964) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3119)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1839)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:201)  at android.app.ActivityThread.main(ActivityThread.java:6864)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)  2021-04-05 18:00:24.997 19725-19725/io.ionic.starter I/Process: Sending signal. PID: 19725 SIG: 9

2021-04-05 18:00:24.953 19725-19725/io.ionic.starter E/AndroidRuntime: FATAL EXCEPTION: main Process: io.ionic.starter, PID: 19725 java.lang.RuntimeException: Unable to start activity ComponentInfo{io.ionic.starter/com.unity3d.player.UnityPlayerActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x0 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2984) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3119) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1839) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:201) at android.app.ActivityThread.main(ActivityThread.java:6864) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873) Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0 at android.content.res.Resources.getText(Resources.java:360) at android.content.res.MiuiResources.getText(MiuiResources.java:97) at android.content.res.Resources.getString(Resources.java:453) at com.unity3d.player.UnityPlayer.GetGlViewContentDescription(Unknown Source:20) at com.unity3d.player.UnityPlayer.<init>(Unknown Source:256) at com.unity3d.player.UnityPlayerActivity.onCreate(UnityPlayerActivity.java:41) at android.app.Activity.performCreate(Activity.java:7232) at android.app.Activity.performCreate(Activity.java:7221) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2964) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3119)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1839)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:201)  at android.app.ActivityThread.main(ActivityThread.java:6864)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873) 

yasirkula commented 3 years ago

This is probably the most important part of the crash log:

Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0 at android.content.res.Resources.getText(Resources.java:360) at android.content.res.MiuiResources.getText(MiuiResources.java:97) at android.content.res.Resources.getString(Resources.java:453) at com.unity3d.player.UnityPlayer.GetGlViewContentDescription(Unknown Source:20) at com.unity3d.player.UnityPlayer.(Unknown Source:256) at com.unity3d.player.UnityPlayerActivity.onCreate(UnityPlayerActivity.java:41)

Does build & running the Unity project without integration cause the same issue?

yasirkula commented 3 years ago

Possible solution: https://stackoverflow.com/questions/56416191/resource-not-found-exception-while-opening-unity-project-in-android-studio/56461957

Same solution, another thread: https://forum.unity.com/threads/unity-2018-3-6-upgrade-to-unity-2018-4-has-bug.681997/

linkedoranean commented 3 years ago

Does build & running the Unity project without integration cause the same issue?

It does not. I was able to install directly from unity and also export to Android Studio and build directly again.

Possible solution: https://stackoverflow.com/questions/56416191/resource-not-found-exception-while-opening-unity-project-in-android-studio/56461957

Same solution, another thread: https://forum.unity.com/threads/unity-2018-3-6-upgrade-to-unity-2018-4-has-bug.681997/

Oh heck! The first one [adding line to strings.xml] worked haha Also I had to remove Android, change the config.xml and force update Android to latest, because Easy AR uses minSDK 25 and Cordova uses 22