couldn't find "libEasyAR.so" on Unity Android build

+1 vote
asked Mar 12, 2019 by ngc6543 (1,670 points)

Hi, I'm trying to build a Unity Android game using EasyAR 2.3.0, and encountered an issue.

I'm building an app on Unity2018.3.8f1. In the editor it runs fine, but built app can't initialize EasyAR saying that

 AndroidJavaException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.envisible.crayontown-1/base.apk"],nativeLibraryDirectories=[/data/app/com.envisible.crayontown-1/lib/arm, /data/app/com.envisible.crayontown-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]] couldn't find "libEasyAR.so"

I've checked the dll on EasyAR/Plugins/Android/libs/armeabi-v7a/libEasyAR.so and made sure that it is included on Android build. And also the CPU is set to ARMv7.

Additionally, I'm not sure why the path contains '-1' or '!' above. Sometimes the '-1' is changed to '-2'.

the log is as follows :

-------------------------------------

03-12 18:39:59.978 16137 16151 I Unity   : SystemInfo CPU = ARMv7 VFPv3 NEON, Cores = 4, Memory = 2964mb
03-12 18:39:59.978 16137 16151 I Unity   : SystemInfo ARM big.LITTLE configuration: 4 big (mask: 0xf), 0 little (mask: 0x0)
03-12 18:39:59.979 16137 16151 I Unity   : ApplicationInfo com.envisible.crayontown version 2.0.2 build 51b6b892-f434-401d-b656-62d46898c91c
03-12 18:39:59.979 16137 16151 I Unity   : Built from '2018.3/staging' branch, Version '2018.3.8f1 (fc0fe30d6d91)', Build type 'Release', Scripting Backend 'mono', CPU 'armeabi-v7a'

... bunch of OpenGL messages ...

03-12 18:40:07.688 16137 16151 E Unity   : AndroidJavaException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.envisible.crayontown-1/base.apk"],nativeLibraryDirectories=[/data/app/com.envisible.crayontown-1/lib/arm, /data/app/com.envisible.crayontown-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]] couldn't find "libEasyAR.so"
03-12 18:40:07.688 16137 16151 E Unity   : java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.envisible.crayontown-1/base.apk"],nativeLibraryDirectories=[/data/app/com.envisible.crayontown-1/lib/arm, /data/app/com.envisible.crayontown-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]] couldn't find "libEasyAR.so"
03-12 18:40:07.688 16137 16151 E Unity   :     at java.lang.Runtime.loadLibrary0(Runtime.java:972)
03-12 18:40:07.688 16137 16151 E Unity   :     at java.lang.System.loadLibrary(System.java:1530)
03-12 18:40:07.688 16137 16151 E Unity   :     at cn.easyar.engine.EasyAR.loadLibraries(EasyAR.java:234)
03-12 18:40:07.688 16137 16151 E Unity   :     at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
03-12 18:40:07.688 16137 16151 E Unity   :     at com.unity3d.player.UnityPlayer.c(Unknown Source)
03-12 18:40:07.688 16137 16151 E Unity   :     at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
03-12 18:40:07.688 16137 16151 E Unity   :     at a

1 Answer

0 votes
answered Mar 12, 2019 by ngc6543 (1,670 points)
I tried toexport the build as an Android project and found that libEasyAR.so and libEasyARUnity.so in Plugins/Android/lib/armeabi-v7a is not exported to built project. I manually copied the *.so files and the project is built fine.

One thing though, In Unity I can set the resolution of the Camera Device using CameraDeviceBehaviour component. But when built, the camera feed resolution isn't what I had set. I set 1280*720, but instead it gives something like 960*540 on the device. The device's camera is capable of sending 1280*720 resolution.
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...