react-native-unity-view
react-native-unity-view copied to clipboard
Exception on Android with BackHandler returning false
Steps to reproduce:
- Add BackHandler to the react native component
- return false in the hardwarebackPress handler
- Press hardware back button on the device. The app will go in background.
- Press the square button on the device to show all the background apps.
- Tap on the app to bring it to foreground
- The app will crash with this exception:
09-27 21:36:59.475 24592-24592/com.myproject.projectname E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.myproject.projectname, PID: 24592
java.lang.Error: FATAL EXCEPTION [main]
Unity version : 2018.1.8f1
Device model : motorola Moto G (5S) Plus
Device fingerprint: motorola/sanders_n/sanders_n:7.1.1/7:user/release-keys
Caused by: java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator() (tried Java_com_unity3d_player_UnityPlayer_nativeRestartActivityIndicator and Java_com_unity3d_player_UnityPlayer_nativeRestartActivityIndicator__)
at com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator(Native Method)
at com.unity3d.player.UnityPlayer.resume(Unknown Source)
at com.reactnative.unity.view.UnityViewManager.onHostResume(UnityViewManager.java:101)
at com.facebook.react.bridge.ReactContext.onHostResume(ReactContext.java:184)
at com.facebook.react.ReactInstanceManager.moveToResumedLifecycleState(ReactInstanceManager.java:649)
at com.facebook.react.ReactInstanceManager.onHostResume(ReactInstanceManager.java:568)
at com.facebook.react.ReactInstanceManager.onHostResume(ReactInstanceManager.java:524)
at com.facebook.react.ReactActivityDelegate.onResume(ReactActivityDelegate.java:102)
at com.facebook.react.ReactActivity.onResume(ReactActivity.java:64)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1291)
at android.app.Activity.performResume(Activity.java:6791)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3427)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3490)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2749)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1490)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6165)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
Can anyone please help me with this ? I really need to fix this crash. It has become a blocking issue for my app update.
Encountered this, but don't have a solution.
I'm trying to integrate react-native-unity-view on a new sample project (both rn and unity projects are fresh starts). I did not run into this issue while getting react-native-unity-demo working
I can get the app loading, but when I click the button to start the unity view, the app crashes with this error