Skip to content

CI: Circular dependency between self-installing Android SDK and Flutter build #28076

@dotdoom

Description

@dotdoom

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:

  1. Download Flutter SDK only, per instructions at https://flutter.io/docs/get-started/install
  2. Clone an existing Flutter application from GitHub
  3. Set ANDROID_HOME and copy accepted licenses hashes from developer workstation into $ANDROID_HOME/licenses/
  4. Run flutter build apk --debug within the cloned application directory

To fix:

  1. Change directory to android within the cloned application
  2. Create local.properties containing flutter.sdk=<flutter sdk path>
  3. Run ./gradlew build, which will install necessary Android SDK packages
  4. Re-run flutter build successfully

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 capabilityt: gradle"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.waiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions