No implementation found for void com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator()

DevT picture DevT · Aug 22, 2018 · Viewed 10.5k times · Source

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)

Answer

user10578038 picture user10578038 · Dec 19, 2018

If you export the unity project in the build.gradle, you need to add this sentence to your android project app.gradle:

defaultConfig {
    ndk {
        abiFilters 'armeabi-v7a', 'x86'
    }
}