正如您所看到的,Fresco有一个arm64-v8a目录,但我不想使用它。在build.gradle中我应该写什么?
compile('com.facebook.fresco:fresco:0.5.3') {
exclude group: 'com.android.support'
exclude group: 'com.nineoldandroids'
exclude group: 'imagepipeline/jni/arm64-v8a'
}
正如您所看到的,Fresco有一个arm64-v8a目录,但我不想使用它。在build.gradle中我应该写什么?
compile('com.facebook.fresco:fresco:0.5.3') {
exclude group: 'com.android.support'
exclude group: 'com.nineoldandroids'
exclude group: 'imagepipeline/jni/arm64-v8a'
}
android {
...
defaultConfig {
...
ndk {
abiFilters "armeabi-v7a", "x86","armeabi"
}
packagingOptions {
exclude "lib/arm64-v8a/mysofile.so"
}
}
}
将mysofile.so替换为您的.so文件。
这里是链接:Shipping Multiple APKs
If your application is not used by devices running Android 2.3 (Gingerbread), you will not need the armeabi flavor.
Android Studio / Gradle# Edit your build.gradle file as follows:
android { // rest of your app's logic splits { abi { enable true reset() include 'x86', 'x86_64', 'arm64-v8a', 'armeabi-v7a', 'armeabi' universalApk false } } }
您需要在 android/app/build.gradle 文件的 android 部分下添加 packagingOptions 条目,如下所示,以从 apk lib 文件夹中排除特定文件或整个文件夹
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
packagingOptions({
exclude 'lib/arm64-v8a/*' //instead of * you can specify perticualr so file name also
exclude 'lib/x86_64/*'
})
}
}