nativeLibraryDirectories=[/data/app/com.lukouapp-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libxxxx.so
一开始我遇到的问题是,如果手机有SD卡槽,则不管有没有插卡,都会闪退,打日记后发现是找不到so文件。报错日记如下:
nativeLibraryDirectories=[/data/app/com.lukouapp-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libxxxx.so
据大神说(转自http://www.jianshu.com/p/a75cc076480f),问题原因:64位机器默认去查找arm64-v8a目录下是否有合适的64位库,如果没有则回去libs下查找32位的库,而fresco的draw-pipeline太完善了考虑了64位的机器所以他的arm64-v8a下有so库,对应的系统就创建了lib64的文件,而不再去找32位的库。
我用的是Android Studio工程,于是修改gradle文件,在defaultConfig {}的里面加上
ndk {
abiFilters "armeabi", "armeabi-v7a", "x86", "mips" }
最终效果如下:
defaultConfig {
applicationId "com.richinfo.travel"
minSdkVersion 14
targetSdkVersion 22
versionCode 3
versionName "1.0.2"
buildConfigField "boolean", "LOG_DEBUG", "true"
consumerProguardFiles 'proguard-file.txt'
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "local"]
ndk {
abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
}}