Closed
Description
@beeender
use realm + VLC ,some devices crash. the error message :
org.videolan.vlc E/VLC/LibVLC﹕ Can't load vlcjni library: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.videolan.vlc-2/base.apk"],nativeLibraryDirectories=[/data/app/org.videolan.vlc-2/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libvlcjni.so"
Activity
cwangzh commentedon Oct 22, 2015
I also want to know
beeender commentedon Oct 22, 2015
@mjliu
cwangzh commentedon Oct 22, 2015
1.samsung s6 、huawei p8 and so on. Only arm64 chipset devices! above Android 5.0 .
2.0.81.1
3.Yes
https://wiki.videolan.org/AndroidCompile/#Devices
Devices
Find the ABI for the target device.
For a normal (2012-2015 consumer phone or tablet) device (e.g. Cortex-A8 or Cortex-A9)
armeabi-v7a
For a Tegra2 device (no NEON)
armeabi-v7a
For an ARMv6 device
armeabi
For an ARMv6 device that does not support FPU
armeabi-nofpu
For an ARMv5 device or the Android Emulator
armeabi-v5
For a x86 device (e.g. Android-x86, Google TV, Logitech TV, Android x86 smartphones, etc)
x86
For a MIPS device (i.e. Ainol Novo tablets):
mips
This value must be passed to the compile.sh script
4.before
5.Yes,Each time will now
@beeender
beeender commentedon Oct 22, 2015
@cwangkkb @mjliu I think the problem is vlc doesn't supply a arm64 so file. In this situation, ASOP should just copy Realm's arm64 so and fallback to copy vlc's armeabi-v7a to app's lib directory.
can you please list all the files recursively in the phone's /data/app/org.videolan.vlc-2/lib/ directory which has this problem? It seems to be an AOSP bug...
dalinaum commentedon Oct 22, 2015
Hello @cwangkkb @mjliu
I just built vlc. There is no aarch64 (arm64) so files.
I think you might encounter
Can't load vlcjni library: java.lang.UnsatisfiedLinkError
without Realm. Did you run your app on arm64 devices before?mjliu commentedon Oct 22, 2015
@dalinaum
without realm the VLC is ok. these devices have no that error
cwangzh commentedon Oct 22, 2015
@dalinaum
I run my app on arm64 devices before without Realm,hasn't problem.
after add realm jar lead to Can't load vlcjni library: java.lang.UnsatisfiedLinkError !
Vlc is no aarch64 (arm64) so files.
I run his demo normal. but add realm throw exceptions!!
Can you try it?
mjliu commentedon Oct 22, 2015
@beeender
I can fetch realm's arm64 so and add this to the vlc anrmeabi-v7a .
but I don't know how to build a realm Jar without arm64 so . there has error multiple-dex
beeender commentedon Oct 22, 2015
@mjliu
I think there is a bug in AOSP, the system failed to fall back to choose a non-64bit version of vlc when other so libs do have arm64 version.
See doc here:
https://realm.io/docs/java/latest/#couldnt-load-librealm-jniso Doc updated.
Simply exclude the
.so
you don't want in gradle like:----UPDATED Nov.17th, NO NEED TO USE BELOW----
One solution is, you can remove the Realm's arm64 so from your apk file and try again. Then the system will just choose non-arm64 so for both, vlc and Realm.To build realm without arm64 so, just modify therealm-jni/build.gradle
asThen run./gradlew androidJar
kneth commentedon Oct 22, 2015
@mjliu Can you confirm that solution proposed by @beeender works for you?
.so
file #1634mjliu commentedon Oct 22, 2015
@kneth
building realm jar. the net is too slow
mjliu commentedon Oct 22, 2015
@beeender @kneth
this issue is resolved by @beeender 's solution.
thanks
we delete the x64 so.
1、what the impact of app without the realm x64 ?
2、have some other hidden troubles ?
1 remaining item
cmelchior commentedon Oct 22, 2015
We should consider adding a section about this to our website. This problem as popped up quite a few times already.
.so
under other platforms #1670leolxmy commentedon Oct 28, 2015
@mjliu Have you solved it?
mjliu commentedon Oct 28, 2015
@leolxmy
Yes have solved
leolxmy commentedon Oct 28, 2015
How to solve?
leolxmy commentedon Oct 28, 2015
@mjliu How to solve?
mjliu commentedon Oct 28, 2015
@leolxmy
To build realm without arm64 so, just
modify the realm-jni/build.gradle as
def targets = [
new Target( name:'arm', jniFolder:'armeabi', toolchain:toolchains.find{it.name == 'arm'}, cflags:[ '-mthumb' ] ),
new Target( name:'arm-v7a', jniFolder:'armeabi-v7a', toolchain:toolchains.find{it.name == 'arm'}, cflags:[ '-mthumb', '-march=armv7-a', '-mfloat-abi=softfp', '-mfpu=vfpv3-d16' ] ),
//new Target( name:'arm64', jniFolder:'arm64-v8a', toolchain:toolchains.find{it.name == 'arm64'}, cflags:[] ),
new Target( name:'mips', jniFolder:'mips', toolchain:toolchains.find{it.name == 'mips'}, cflags:[] ),
new Target( name:'x86', jniFolder:'x86', toolchain:toolchains.find{it.name == 'x86'}, cflags:[] ),
new Target( name:'x86_64', jniFolder:'x86_64', toolchain:toolchains.find{it.name == 'x86_64'}, cflags:[] )
]
Then run ./gradlew androidJar
leolxmy commentedon Oct 28, 2015
@mjliu Can you give me a demo? I'm not quite understand
beeender commentedon Oct 28, 2015
@leolxmy Or you can just use our released jar file, and open it with normal archive tools, remove the arm64 directory. jar file is just a zip file.
beeender commentedon Nov 4, 2015
https://realm.io/docs/java/latest/#couldnt-load-librealm-jniso Doc updated.