我想生成支持以下内容的apk文件: 'armeabi-v7a','arm64-v8a','x86','x86_64'
我使用了命令:
flutter build apk --flavor production
还有
flutter build appbundle --target-platform android-arm,android-arm64
结果将始终仅为arm64-v8a和armeabi-v7a
我试图在android / build.gradle中更改defaultConfig
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "XXX"
minSdkVersion 16
targetSdkVersion 28
versionCode VERSION_CODE
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [AppLabelName: "XXX"]
multiDexEnabled true
ndk {
abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
}`
然后运行
flutter build apk --flavor production
仍然不起作用, 当我尝试在
上进行测试时ASUS T00P • EAAZCY03U504 • android-arm • Android 4.4.2 (API 19)
它总是显示错误
Performing Push Install
build\app\outputs\apk\production\release\app-production-release.apk: 1 file pushed. 3.5 MB/s (33320272 bytes in 9.085s)
pkg: /data/local/tmp/app-production-release.apk
Failure [INSTALL_FAILED_MEDIA_UNAVAILABLE]