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

4

11

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)

Alcala answered 22/8, 2018 at 2:27 Comment(1)
Found any solution ??Kelle
E
6

Try enabling ARM64:

  1. Update unity to 2018.3
  2. In android player settings change "scripting backend" to IL2CPP.
  3. In android player settings mark ARM64 checkbox as selected.
Eleonoreeleoptene answered 3/2, 2019 at 11:30 Comment(1)
Yes you are correct, changing "scripting backend" to IL2CPP will generate ARM64, but all SDK's in your Unity project should extend their support to ARM64 in order for Unity to generate those files.Alcala
T
5

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'
    }
}
Tobolsk answered 19/12, 2018 at 2:58 Comment(0)
S
1

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.

JNI libraries

If there is, check the gradle files which of the paths are correctly added

gradle files

Stets answered 20/12, 2018 at 12:14 Comment(0)
A
1

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.

Alcala answered 7/1, 2019 at 20:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.