If some other export (unity as library for android) is generated with the same Unity 2020.2b and attached to the sample code as a library, it works.
Unity 2020.2b2 Windows 10
Android Studio Android Studio 4.0.1
Build #AI-193.6911.18.40.6626763, built on June 25, 2020
Runtime version: 1.8.0_242-release-1644-b01 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1237M
Cores: 12
Registry: ide.new.welcome.screen.force=true
Non-Bundled Plugins: com.google.services.firebase
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.unity.mynativeapp:Unity, PID: 7701
java.lang.UnsatisfiedLinkError: dlopen failed: library "/data/app/com.unity.mynativeapp-dKUmHF3qDo8UGC74BxpWSA==/lib/arm64/libmain.so" not found
at java.lang.Runtime.load0(Runtime.java:938)
at java.lang.System.load(System.java:1631)
at com.unity3d.player.UnityPlayer.loadNative(Unknown Source:18)
at com.unity3d.player.UnityPlayer.<init>(Unknown Source:164)
at com.unity3d.player.UnityPlayerActivity.onCreate(UnityPlayerActivity.java:41)
at com.company.product.OverrideUnityActivity.onCreate(OverrideUnityActivity.java:16)
at com.unity.mynativeapp.MainUnityActivity.onCreate(MainUnityActivity.java:16)
at android.app.Activity.performCreate(Activity.java:7955)
at android.app.Activity.performCreate(Activity.java:7944)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3423)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3595)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2147)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7814)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
Any help how to make AR examples work “as a library” for Android is greatly needed! Thank you!
We weren’t able to reproduce the issue locally yet. It would be much appreciated if you could submit bug reports with reproduction steps and reproduction projects attached.
Hello @LeonhardP , I’ve created a self-contained project demonstrating the bug and attached it to my bug report 1321977 on FogBugz. Hope it gets looked at soon since it’s a show stopper.
I’ve upgraded the project to 2021.1.1f1 and the bug is still there.
Could someone please check out my minimal Github repo which demonstrates the bug and see if they’re getting the same error when running on the device? You can open the /uaal-bug-native folder from Android Studio and run it. The project is exported from the Unity project (at /uaal-bug-unity) into the /uaal-bug-native/unityAndroidBuild folder. The git log shows the sequence of steps I took to get there.
@LeonhardP I’ve updated the repository to Unity 2021.1.3f1 and I’m still seeing the bug. I’m using a Samsung S7 to test. I’d love to help squash this if you can point me in the right direction.