Java – unable to load (find) j2v8_ android_ X86 Library

I have a gradle project that uses j2v8_ Android 2.2.1 Library (provides Java binding for V8 JS engine – Android port). Unfortunately, after executing the project (there is no problem with successful construction), I get a connection with the lack of j2v8_ android_ X86 library file related exception. There will be a problem when trying to create V8 Runtime:

V8 runtime = V8.createV8Runtime();

The exceptions themselves are:

Caused by: java.lang.IllegalStateException: J2V8 native library not loaded.
        at com.eclipsesource.v8.V8.checkNativeLibraryLoaded(V8.java:86)
        at com.eclipsesource.v8.V8.createV8Runtime(V8.java:74)
        at com.eclipsesource.v8.V8.createV8Runtime(V8.java:63)
        (...)
Caused by: java.lang.UnsatisfiedLinkError: Could not load J2V8 library. Reasons:
Couldn't load j2v8_android_x86 from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.androidscripting.app-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.androidscripting.app-1, /vendor/lib, /system/lib, /system/lib/arm]]]: findLibrary returned null
        at com.eclipsesource.v8.LibraryLoader.loadLibrary(LibraryLoader.java:71)
        at com.eclipsesource.v8.V8.load(V8.java:49)
        at com.eclipsesource.v8.V8.createV8Runtime(V8.java:72)
        ... 17 more

When I investigate APK, I see two library files (libj2v8_android_armv7l.so and libj2v8_android_x86. So) in the root directory of APK. If I understand them correctly, the names and locations of those files are correct and should be solved

The application is compiled and packaged by gradle 2.2.1 (on Oracle JVM 1.8.0_45), compatible with Android SDK 19 (supporting language level 1.7), and executed on hudl2 running Android 4.4.2

resolvent:

After talking with my university, we found the solution. The path classloader is not actually in the root directory of APK - but in LIBS / [Architecture]. Libj2v8_ android_ Moving the x86.so file to LIBS / x86 and repackaging does solve this problem

I think Maven modules may have been packaged as old versions, so they were not copied to the correct directory at build time - or they may just be misconfigured

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>