Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
227 views
in Technique[技术] by (71.8m points)

javascript - React Native: Android couldn't find "libj2v8utils.so"

I have a tricky problem with Android builds. The framework I use is React Native 0.61.5.

I have to use a particular SDK which needs to use a library called libj2v8utils.so. After some deepening I noticed that this library should be accompanied with another one: libj2v8.so.

The libj2v8.so library is always present in the <root>/android/app/build/intermediates/merged_native_libs/debug/out/lib/arm64-v8a path (all architectures), while the libj2v8utils.so library is present only for the arm64-v8a architecture.

Unfortunately I am not an expert in the Android environment and what concerns the project configurations with Maven, build.gradle and so on. However, I have made a few attempts like the following:

packagingOptions {
        pickFirst '**/*.so'
    }

or

sourceSets {
        main {
            jniLibs.srcDirs = ['src/main/jnilibs']
        }
    }

All without success.

The details of the error are as follows:

java.lang.NoClassDefFoundError: com.my.custom.sdk.common.internal.core.utils.J2V8Utils
...
can't get JS engine attributes
MyCustomSDK: Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/my.bundle123==/base.apk"],nativeLibraryDirectories=[/data/app/my.bundle123==/lib/arm, /data/app/my.bundle123==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]] couldn't find "libj2v8utils.so"

Finally, in the application logs I see:

authentication failed Internal error occurred (TypeError: t.getData is not a function)

The following screenshots show the libraries generated for the different architectures:

enter image description here

When I build the APK by npx react-native run-android I don't notice anything in particular. How can I solve this issue?

question from:https://stackoverflow.com/questions/65904443/react-native-android-couldnt-find-libj2v8utils-so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...