Android在64位机器上(三星S6,华为P8等)找不到其他so库

参考于http://blog.csdn.net/shihyWork/article/details/51263625
异常如下:

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

解决办法:
(1)编辑build.gradle,把没有so文件的目录删除掉,留下有so文件的目录

android {
  // rest of your app's logic
  splits {
abi {
    enable true
    reset()
    include 'x86', 'x86_64', 'armeabi-v7a', 'armeabi'
    universalApk false
}
}
}

(2)如果还报错,注释掉下面一行(如果你的主要工程目录没有加入lib和jar的话)

dependencies {
//    compile fileTree(include: ['*.jar'], dir: 'libs')
}

原理:

  • enable: enables the ABIs split mechanism
  • exclude: By default all ABIs are included, you can remove some ABIs.
  • include: indicate which ABIs to be included
  • reset(): reset the list of ABIs to be included to an empty string (this allows, in conjunctions with include, to indicate which one to use rather than which ones to ignore)
  • universalApk: indicates whether to package a universal version (with all ABIs) or not. Default is false.

你可能感兴趣的:(Android在64位机器上(三星S6,华为P8等)找不到其他so库)