[英]Can not release appBundle cause of AndroidX incompatibilities in this Flutter app
I want to release appBundle with 'flutter build appbundle' but I have this error. 我想使用“ flutter build appbundle”发布appBundle,但出现此错误。 This project has already been migrated to AndroidX.
该项目已被迁移到AndroidX。 There are not used third-party libraries
没有使用过的第三方库
compileSdkVersion: 28
targetSdkVersion: 28
minSdkVersion: 16
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
dependencies {
implementation 'com.android.support:support-fragment:28.0.0'
}
}
}
dependencies: 依赖项:
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
in gradle.properties 在gradle.properties中
android.useAndroidX=true
android.enableJetifier=true
In the file android/gradle/wrapper/gradle-wrapper.properties check the distributionUrl must be: 在文件android / gradle / wrapper / gradle-wrapper.properties中,检查distributionUrl必须为:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
On the file android/build.gradle , change: 在文件android / build.gradle上 ,更改:
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
to: 至:
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
On the file android/app/build.gradle , replace the line: 在文件android / app / build.gradle上 ,替换以下行:
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
to: 至:
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
I've solved my question: 我已经解决了我的问题:
dependencies of implementing support-fragment should be deleted, because I followed this answer: https://github.com/flutter/flutter/issues/28979#issuecomment-476426976 应该删除实现支持碎片的依赖项,因为我遵循了以下答案: https : //github.com/flutter/flutter/issues/28979#issuecomment-476426976
change minifyEnabled to false 将minifyEnabled更改为false
and then I used: 然后我用:
flutter clean
flutter packages get
flutter build appbundle
该修复程序在v1.7.8 + hotfix.2版本的Beta通道中有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.