问题
I'm new to Unity, I'm trying to integrate Unity game(it has ARcore) into the native Android application.
I'm able to launch unity in a new HelloWorld app but unable to launch in my real app(which has other modules).
Note: When I'm building an android library from Unity project, I'm including armeabi-v7a and x86 architectures.
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:37)
at com.rccl.soakTest.UnityPlayerActivity.onResume(UnityPlayerActivity.java:58)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1361)
at android.app.Activity.performResume(Activity.java:7344)
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:0)
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(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Tested on the following Device: SamsungS8 (Oreo), Emulator-Nexus 6(Oreo)
回答1:
Try enabling ARM64:
- Update unity to 2018.3
- In android player settings change "scripting backend" to IL2CPP.
- In android player settings mark ARM64 checkbox as selected.
回答2:
If you export the unity project in the build.gradle
Modify your projects build.gradle
file to include the following:
defaultConfig {
ndk {
abiFilters 'armeabi-v7a', 'x86'
}
}
回答3:
In my case, It caused by JNI libraries.
I made an empty Android project and added unity project as a module.
So default Android project can't find the correct JNI libraries and it causes the crash same as your error message.
If you check your JNI files are on the project.
If there is, check the gradle files which of the paths are correctly added
回答4:
Finally I got the reason for that issue,
ISSUE: It is looking for JNI libs (.so) files for ARM-64architecture.
ARCore currently is not extending their support for ARM64 (https://github.com/google-ar/arcore-unity-sdk/issues/201 . -> It was fixed now) and the app is crashing.
My app only supports ARM64 and ARMV7.. When I exclude ARM64 from ABI Filters and SPlits. It works.
Im no more using ARCore due to other issues.
来源:https://stackoverflow.com/questions/51959096/no-implementation-found-for-void-com-unity3d-player-unityplayer-nativerestartact