/lib/arm64, /vendor/lib64, /system/lib64 couldn't find "libstlport_shared.so"

当引用so文件时,部份手机会报这个错

 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.hx.template-2/base.apk"],nativeLibraryDirectories=[/data/app/com.hx.template-2/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libstlport_shared.so"

原因是这部份手机是64位处理器的,所以找so的时候先从/lib/arm64, /vendor/lib64, /system/lib64这几个目录找。
解决方法:
在gradle.properties加上

android.useDeprecatedNdk=true

build.gradle加上

android {
    ...
    defaultConfig {
        ...
        ndk {
            abiFilters "armeabi-v7a", "x86", "armeabi"
        }
    }
}

感谢:http://www.jianshu.com/p/7fa8392c2f1c 提出的解决方法

猜你喜欢

转载自blog.csdn.net/u012153184/article/details/54599247
今日推荐