When I try to build > generate signed bundle
AS complains:
Generating signed bundle requires you to update the Android Gradle plugin to version 3.2.0 or higher
If I click on Close this dialog and update the plugin
A further dialog appears (AS Bumblebee) titled update the Android Gradle plugin
If I hit OK, the dialog vanishes, nothing happens, and I get the same complaint when I try to build a signed app bundle again.
This is really frustrating because I can't upload an app with Googlemaps without signing it. That's my whole app!
OK well similar problems have been answered a few times on StackOverflow, but some of the solutions have become antiquated other solutions don't seem relevant:
- I can see no way to update Gradle through
File > project structure
in Android Studio Bumblebee. - If I try and update Gradle manually in
android/build.gradle
, well it already has gradle 7.03, which is way above 3.2.0. Although Gradle and Android Studio's Gradle plugin may have different version numbers. See the code snippet below. - I've tried using Android Studio's search box with 'update Gradle plugin' to no effect.
- I've hunted around
Preferences > SDK tools
, but no mention of a gradle plugin. - Instead of using an app bundle I've tried generating a signed APK, but that has problems too, and the file is larger, so no easy solution.
This is the relevant part of my android/build.gradle
file:
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.5'
}
FURTHER investigation, gradle-wrapper.properties
contains this:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
Which is a different version number to my android/build.gradle
:
classpath 'com.android.tools.build:gradle:7.0.3'
I'm not sure why they have different numbers.
This is the last hurdle for one app, and a roadblock in another, please help. I'm totally lost, I've begun to think maybe a Kotlin plugin upgrade has caused havoc somehow.
UPDATE I've reported the issue to Google, via AS's help menu, and in doing so the report said this...
AS: Bumblebee | 2021.1.1; Kotlin plugin: 211-1.6.10-release-923-AS7442.40; Android Gradle Plugin: (plugin information not found); Gradle: (gradle version information not found); Gradle JDK: version 11.0.11; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
That's a lot of things missing! Both gradle and the gradle plugin. I've tried creating a fresh project in AS Bumblebee then asking for a signed bundle but get the same complaint, so it's not because the projects have taken a while.
Any solutions are appreciated. I thought you just downloaded Android Studio and it was all good to go... sigh.
UPDATE attempted the solution offered below, but I do not appear to have a Gradle location set, as per picture...
https\://services.gradle.org/distributions/gradle-6.7-all.zip
, the gradle version on android/build.gradle is'com.android.tools.build:gradle:4.1.0'
. That's what Flutter generates on my machine currently by default at least. Try bumping down the version that you're using by a notch and see if it works for you. Using the most latest gradle plugin doesn't seem to be necessary. – Metts