天天看点

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader couldn‘t find “libtinyWRAP.so“

错误

2020-09-05 20:50:52.981 26117-26117/net.quantum6.telecom E/AndroidRuntime: FATAL EXCEPTION: main
    Process: net.quantum6.telecom, PID: 26117
    java.lang.UnsatisfiedLinkError: 
    dalvik.system.PathClassLoader[
    DexPathList[[zip file "/data/app/net.quantum6.telecom-43u60zJI0corNPWaUF3ZjQ==/base.apk"],
    nativeLibraryDirectories=[
    /data/app/net.quantum6.telecom-43u60zJI0corNPWaUF3ZjQ==/lib/arm64, 
    /data/app/net.quantum6.telecom-43u60zJI0corNPWaUF3ZjQ==/base.apk!/lib/arm64-v8a, 
    /system/lib64, /hw_product/lib64, /system/product/lib64, /prets/lib64]]] couldn't find "libtinyWRAP.so"
        at java.lang.Runtime.loadLibrary0(Runtime.java:1067)
        at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
        at java.lang.System.loadLibrary(System.java:1668)      
  • 解决办法

1. 保证libs下有相应的armeabi-v7a(看情况,也可以有armeabi)

2. build.gradle改为类似如下:

android {
    defaultConfig {
        ......
        ndk {
            abiFilters "armeabi-v7a"
        }
    }
 
    sourceSets {
        main {
        ......
            jniLibs.srcDirs = ['libs']
        }      

3. 库、app都要改。否则还是可能报错。

继续阅读