Skip to content

Conversation

@mit-mit
Copy link
Member

@mit-mit mit-mit commented Sep 29, 2017

Handle the common Gradle failure where a project specifies a set of Android SDK components not currently downloaded, and the license for those components has not been accepted.

Fixes #8438

Sample output:

$ ~/dev/mit-flutter/bin/flutter build apk
Building flutter tool...
Running "flutter packages get" in lic1...             0.5s
Initializing gradle...                                1.1s
Resolving dependencies...                                |

* Error running Gradle:
Unable to download needed Android SDK components, as the following licenses have not been accepted:
Android SDK Build-Tools 25

To resolve this, please run the following command in a Terminal:
flutter doctor --android-licenses
$

Copy link
Contributor

@jakobr-google jakobr-google left a comment

Choose a reason for hiding this comment

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

LGTM

final Match licenseMatch = licenseFailure.firstMatch(exceptionString);
if (licenseMatch != null) {
final String missingLicenses = licenseMatch.group(1);
if (matcher.isNotEmpty) {
Copy link
Contributor

Choose a reason for hiding this comment

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

matcher is a constant string. Did you mean missingLicenses?

And what if missingLicenses is empty -- there's still a problem with the licenses (since we have a match), but we don't tell users how to fix it.

Copy link
Contributor

@mravn-google mravn-google left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jakobr-google jakobr-google left a comment

Choose a reason for hiding this comment

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

LGTM

@mit-mit mit-mit merged commit 3f6b28d into flutter:master Sep 29, 2017
@mit-mit mit-mit deleted the licenses branch September 29, 2017 11:49
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flutter run fails in a very ugly way if you haven't signed Android Studio EULAs

4 participants