简体   繁体   English

无法在此Flutter应用中发布导致AndroidX不兼容的appBundle原因

[英]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.

相关问题 此 Flutter 应用程序中的 Gradle 失败 AndroidX 不兼容 - The Gradle failure AndroidX incompatibilities in this Flutter app Gradle 失败可能是因为这个 Flutter 应用程序中的 AndroidX 不兼容 - The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app flutter 在发布模式下构建 appbundle - flutter building appbundle in release mode 带有 --androidx 的新 Flutter 项目有 AndroidX 不兼容错误 - New Flutter project with --androidx has AndroidX incompatibilities error Flutter 闪屏 - 由于插件中的 AndroidX 不兼容,构建失败 - Flutter splash screen - The build failed likely due to AndroidX incompatibilities in a plugin Flutter - Appbundle - Android 应用程序在启动时冻结 - Flutter - Appbundle - Android app freezes on start AndroidX 不兼容问题出现在我的 Flutter 项目中,同时运行我的 flutter 项目 - AndroidX incompatibilities issue arises in my Flutter project while run my flutter project 原因:androidx.navigation.safeargs 只能与 androidx 项目一起使用 - Cause: androidx.navigation.safeargs can only be used with an androidx project 由于错误膨胀类 androidx.constraintlayout.widget.ConstraintLayout 导致无法在 Android Studio 上运行我的应用程序 - Can't run my App on Android Studio cause by Error inflating class androidx.constraintlayout.widget.ConstraintLayout Flutter build appbundle 为暂存和生产应用程序生成错误的环境变量 - Flutter build appbundle generate wrong environment variable for staging and production app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM