Skip to content

[flutter_tools] Fix for Unsupported Android Plugin version.#46260

Closed
slightfoot wants to merge 1 commit intoflutter:masterfrom
slightfoot:dev
Closed

[flutter_tools] Fix for Unsupported Android Plugin version.#46260
slightfoot wants to merge 1 commit intoflutter:masterfrom
slightfoot:dev

Conversation

@slightfoot
Copy link
Member

@slightfoot slightfoot commented Dec 6, 2019

Build getting a weird error since upgrade:
Unsuported Android Plugin version: 3.5.2

Tracked it down to this line:

throwToolExit('Unsuported Android Plugin version: $androidPluginVersion.');

According to the comments above the function the details for this compatibility was from https://developer.android.com/studio/releases/gradle-plugin#updating-gradle which clearly states 3.5.0+ requires gradle version 5.6.4. This is not what is in the dart code for the flutter tool and so the latest android plugin/studio builds 3.5.1 to 3.5.3 are not compatible with the latest hotfix branch of the tool.

@fluttergithubbot fluttergithubbot changed the base branch from dev to master December 6, 2019 22:59
@fluttergithubbot
Copy link
Contributor

This pull request was opened against a branch other than master. Since Flutter pull requests should not normally be opened against branches other than master, I have changed the base to master. If this was intended, you may modify the base back to dev. See the Release Process for information about how other branches get updated.

Reviewers: Use caution before merging pull requests to branches other than master. The circumstances where this is valid are very rare.

/cc @dnfield

@fluttergithubbot
Copy link
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Dec 6, 2019
@dnfield dnfield requested a review from blasten December 6, 2019 23:10
@blasten
Copy link

blasten commented Dec 6, 2019

This probably needs a unit test

@timsneath
Copy link
Contributor

Marking for consideration as release blocker. cc @tvolkert

@blasten
Copy link

blasten commented Dec 7, 2019

I don't think it's a release blocker since we don't expect folks to upgrade Gradle/Android Gradle plugin on their own. We also need to make sure that those components are compatible with the Flutter Gradle plugin. This AGP version might work, but generally speaking we want to have test for each version that we support.

@blasten
Copy link

blasten commented Dec 7, 2019

To summarize, Android Studio 3.5.3 started showing a banner that recommends to update the Android Gradle plugin to a version that the tool doesn't handle.

I'm not sure about the full impact of this issue though.

return '5.6.2';
}
throwToolExit('Unsuported Android Plugin version: $androidPluginVersion.');
if (Version.parse(androidPluginVersion) > Version.parse('3.5.0')) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just return '5.6.4' and remove this check and throwToolExit. Finally, update the unit test.

@tvolkert
Copy link
Contributor

tvolkert commented Dec 7, 2019

This definitely needs a test.

Also, are we sure this is a release blocker? How common do we expect this failure mode to be?

@dnfield
Copy link
Contributor

dnfield commented Dec 7, 2019

I don't think this should be a release blocker. We need to do testing to make sure this all plays nicely. It's not on our default templates yet and using it may have other problems that need to be vetted out.

We should definitely fix this but it should really go through a longer cycle on dev/beta before being brought into the release.

@timsneath
Copy link
Contributor

timsneath commented Dec 7, 2019 via email

@tvolkert
Copy link
Contributor

tvolkert commented Dec 9, 2019

Removing release blocker label. As @dnfield and @blasten say, we really should do more comprehensive testing of this through the normal channels and give it time to bake.

@zanderso zanderso added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 19, 2019
@arnemolland arnemolland mentioned this pull request Dec 25, 2019
@zanderso
Copy link
Member

zanderso commented Jan 9, 2020

@blasten is this PR still relevant?

@blasten
Copy link

blasten commented Jan 9, 2020

I think so. @slightfoot are you still interested in working on this PR?

@slightfoot
Copy link
Member Author

I think so. @slightfoot are you still interested in working on this PR?

Sure.

@sidhijakpat
Copy link

sidhijakpat commented Jan 11, 2020

In my case this is happening when I run flutter build apk with
setProperty("archivesBaseName", "AppName-" + versionName + "_" + versionCode) enabled,

when I disable those line, flutter build apk was running just fine.

I try to build the release apk using android studio, by opening android folder on project, and it turn out to be fine with those line enabled.

maybe it can help you tracing the error.


additional note:

➜  ~ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2 19C57,
    locale en)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor
      --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
[✓] Android Studio (version 3.5)
[✓] Connected device (1 available)

classpath 'com.android.tools.build:gradle:3.5.3'


Another note:
running
flutter clean
flutter pub cache repair

didn't fix the issue

@sidhijakpat
Copy link

turn out the problem is occur too when try to run on android,
not only flutter build apk,

In my case this is happening when I run flutter build apk with
setProperty("archivesBaseName", "AppName-" + versionName + "_" + versionCode) enabled,

when I disable those line, flutter build apk was running just fine.

I try to build the release apk using android studio, by opening android folder on project, and it turn out to be fine with those line enabled.

maybe it can help you tracing the error.

additional note:

➜  ~ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2 19C57,
    locale en)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor
      --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
[✓] Android Studio (version 3.5)
[✓] Connected device (1 available)

classpath 'com.android.tools.build:gradle:3.5.3'

Another note:
running
flutter clean
flutter pub cache repair

didn't fix the issue

@blasten
Copy link

blasten commented Jan 24, 2020

I filed #49438. This will likely involve updating the Gradle version in the template as well.

@blasten blasten closed this Jan 24, 2020
@abhimangalms
Copy link

I'm also facing the same issue.
current Gradle version is 5.4.1. But still nothing happens.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tool Affects the "flutter" command-line tool. See also t: labels. waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Projects

None yet

Development

Successfully merging this pull request may close these issues.