Android studio says I need to upgrade to Android Gradle plugin 3.2.0 while I'm on 3.4.1

Viewed 794

I have a flutter app, which works perfectly. With flutter build appbundle I am able to build a signed app bundle without any errors. Now, I am trying to generate a signed app bundle and export the encrypted key to upload my app to the play store. However, when I go to Build -> Generate Signed App Bundle -> Android App Bundle I get the following error:

Generating signed Bundle requires you to update the Android Gradle plugin to version 3.2.0 or higher

When I run flutter build appbundle -v I can see that I'm using Gradle 5.1.1 which according to this website suggests I am indeed using Gradle Android plugin 3.4.1

I've already tried setting my project structure to Android-Gradle instead of Android. However, now I'm not able to select the Generate Signed App Bundle anymore. I've also tried a lot of different Gradle and Android Gradle plugin version, but none of them seem to work. Android Studio etc are all updated (version 3.5.1). My Flutter and Dart plugins are also on the latest versions.

My main build.gradle:

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

My gradle-wrapper.properties:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl = https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

Part of flutter build appbundle -v:

 ------------------------------------------------------------
                    Gradle 5.1.1
 ------------------------------------------------------------

Build time:   2019-01-10 23:05:02 UTC
Revision:     3c9abb645fb83932c44e8610642393ad62116807

Kotlin DSL:   1.1.1
Kotlin:       1.3.11
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          1.8.0_202-release (JetBrains s.r.o 25.202-b03)
OS:           Windows 10 10.0 amd64

I am not sure what to do anymore, so any suggestions will help!

0 Answers
Related