react-native-unity-view
react-native-unity-view copied to clipboard
UnsatisfiedLinkError on Android
I'm running into theses errors on Android lately. Does anyone experience something similar?
UnsatisfiedLinkError
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(Unknown Source)
at com.unity3d.player.UnityPlayer.resume(Unknown Source:23)
at com.reactnative.unity.view.UnityViewManager.onHostResume(UnityViewManager.java:63)
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:105)
at com.facebook.react.ReactActivity.onResume(ReactActivity.java:64)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1361)
at android.app.Activity.performResume(Activity.java:7353)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3763)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3828)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3036)
at android.app.ActivityThread.-wrap11(Unknown Source)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Unity
2018.3.6f1
react-native-unity-view
1.3.3
React Native Environment Info
System:
OS: macOS 10.14
CPU: (8) x64 Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz
Memory: 461.81 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.15.0 - /usr/local/opt/node@8/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/opt/node@8/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 21, 23, 24, 25, 26, 27, 28
Build Tools: 23.0.1, 26.0.2, 27.0.1, 27.0.3, 28.0.1, 28.0.3
System Images: android-21 | Google APIs ARM EABI v7a, android-26 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5199772
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.5.0 => 16.5.0
react-native: 0.57.8 => 0.57.8
This issue seems to be related.
Here is a list of some devices the error is happening:
SAMSUNG
HTC
NOKIA
+1
We just ran into this when trying to upgrade from React Native 57.3 to 58.6
Has anyone already figured out how to solve this issue?
I found that the problem occurred in two cases;
- User presses the back button until the app closes
- App is in the background for a long period of time
It seems like the unity libs are unloaded from the classpath when this happens?
I made some changes to re-initialize the unity player instance when this happens. I made a fork for this (https://github.com/f111fei/react-native-unity-view/compare/master...honeyp0t:master) with a tiny fix, which I use in conjunction with a call to UnityModule.createUnity()
whenever the app is opened (not just on initial launch).
Not claiming that this is the solution 💯 , as the unity startup takes some time, but I'm testing it out right now and it seems to have resolved the crash in my app. 😅
@honeyp0t thanks for sharing this. Do you have @f111fei any thoughts on this?
@JanOwiesniak Did you ever find a solution for this? I'm running into it again
@mtostenson we decided to move away from this library because we feel that it is not reliable for production.
Update, I was not using il2cpp for my scripting backend. Between that and adding ARM64 target I don't have this issue anymore.
使用
没有明白