1

I want to release appBundle with 'flutter build appbundle' but I have this error. This project has already been migrated to AndroidX. There are not used third-party libraries enter image description here

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

android.useAndroidX=true
android.enableJetifier=true

3 Answers3

1

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

change minifyEnabled to false

and then I used:

flutter clean
flutter packages get
flutter build appbundle
0

In the file android/gradle/wrapper/gradle-wrapper.properties check the distributionUrl must be:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

On the file android/build.gradle, change:

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:

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

to:

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
0

The fix is live on the beta channel, in release v1.7.8+hotfix.2

Mikhail Tokarev
  • 2,843
  • 1
  • 14
  • 35