-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Labels
c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityt: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.waiting for PR to land (fixed)A fix is in flightA fix is in flight
Description
Would it be possible to let Gradle download Android SDK packages as explained in https://developer.android.com/studio/intro/update#download-with-gradle, instead of requiring an existing Android SDK to be installed?
Steps to Reproduce
Running on CI:
- Download Flutter SDK only, per instructions at https://flutter.io/docs/get-started/install
- Clone an existing Flutter application from GitHub
- Set
ANDROID_HOMEand copy accepted licenses hashes from developer workstation into$ANDROID_HOME/licenses/ - Run
flutter build apk --debugwithin the cloned application directory
To fix:
- Change directory to
androidwithin the cloned application - Create
local.propertiescontainingflutter.sdk=<flutter sdk path> - Run
./gradlew build, which will install necessary Android SDK packages - Re-run
flutter buildsuccessfully
Note that running ./gradlew build before flutter build fails for the lack of local.properties, i.e. these steps rely on an undocumented property to be set.
Logs
Without an Android SDK:
$ flutter build apk --debug
No Android SDK found. Try setting the ANDROID_SDK_ROOT environment variable.$ flutter doctor -v
[✓] Flutter (Channel beta, v1.1.8, on Linux, locale en_US.UTF-8)
• Flutter version 1.1.8 at /home/artem/pkg/flutter
• Framework revision 985ccb6d14 (6 weeks ago), 2019-01-08 13:45:55 -0800
• Engine revision 7112b72cc2
• Dart version 2.1.1 (build 2.1.1-dev.0.1 ec86471ccc)
Metadata
Metadata
Assignees
Labels
c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityt: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.waiting for PR to land (fixed)A fix is in flightA fix is in flight