GoogleCloudPlatform / GoogleCloudPlatform/cloud-builders-community
Flutter builder fails with Android sdkmanager not found and android-licenses errors
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 848
- PR merge metrics
- No merged PRs in 30d
Description
## Affected builder image
gcr.io/cloud-builders-community/flutter
Trying to build Flutter image and getting the error below
`gcloud builds submit --config cloudbuild.yaml .`
```
Step #0: ╔════════════════════════════════════════════════════════════════════════════╗
Step #0: ║ Welcome to Flutter! - https://flutter.dev ║
Step #0: ║ ║
Step #0: ║ The Flutter tool uses Google Analytics to anonymously report feature usage ║
Step #0: ║ statistics and basic crash reports. This data is used to help improve ║
Step #0: ║ Flutter tools over time. ║
Step #0: ║ ║
Step #0: ║ Flutter tool analytics are not sent on the very first run. To disable ║
Step #0: ║ reporting, type 'flutter config --no-analytics'. To display the current ║
Step #0: ║ setting, type 'flutter config'. If you opt out of analytics, an opt-out ║
Step #0: ║ event will be sent, and then no further information will be sent by the ║
Step #0: ║ Flutter tool. ║
Step #0: ║ ║
Step #0: ║ By downloading the Flutter SDK, you agree to the Google Terms of Service. ║
Step #0: ║ Note: The Google Privacy Policy describes how data is handled in this ║
Step #0: ║ service. ║
Step #0: ║ ║
Step #0: ║ Moreover, Flutter includes the Dart SDK, which may send usage metrics and ║
Step #0: ║ crash reports to Google. ║
Step #0: ║ ║
Step #0: ║ Read about data we send with crash reports: ║
Step #0: ║ https://flutter.dev/docs/reference/crash-reporting ║
Step #0: ║ ║
Step #0: ║ See Google's privacy policy: ║
Step #0: ║ https://policies.google.com/privacy ║
Step #0: ╚════════════════════════════════════════════════════════════════════════════╝
Step #0:
Step #0: Analytics reporting disabled.
Step #0:
Step #0: You may need to restart any open editors for them to read new settings.
Step #0: Removing intermediate container d338229261c9
Step #0: ---> 8f8922af3ab7
Step #0: Step 22/28 : RUN flutter precache
Step #0: ---> Running in f20224728023
Step #0: Downloading Material fonts... 691ms
Step #0: Downloading Gradle Wrapper... 52ms
Step #0: Downloading android-arm-profile/linux-x64 tools... 611ms
Step #0: Downloading android-arm-release/linux-x64 tools... 459ms
Step #0: Downloading android-arm64-profile/linux-x64 tools... 480ms
Step #0: Downloading android-arm64-release/linux-x64 tools... 427ms
Step #0: Downloading android-x64-profile/linux-x64 tools... 365ms
Step #0: Downloading android-x64-release/linux-x64 tools... 304ms
Step #0: Downloading android-x86 tools... 2,966ms
Step #0: Downloading android-x64 tools... 2,732ms
Step #0: Downloading android-arm tools... 1,488ms
Step #0: Downloading android-arm-profile tools... 530ms
Step #0: Downloading android-arm-release tools... 523ms
Step #0: Downloading android-arm64 tools... 1,496ms
Step #0: Downloading android-arm64-profile tools... 755ms
Step #0: Downloading android-arm64-release tools... 542ms
Step #0: Downloading android-x64-profile tools... 553ms
Step #0: Downloading android-x64-release tools... 690ms
Step #0: Downloading android-x86-jit-release tools... 714ms
Step #0: Downloading Web SDK... 4.4s
Step #0: Downloading package sky_engine... 153ms
Step #0: Downloading flutter_patched_sdk tools... 255ms
Step #0: Downloading flutter_patched_sdk_product tools... 265ms
Step #0: Downloading linux-x64 tools... 2,943ms
Step #0: Downloading linux-x64/font-subset tools... 231ms
Step #0: Removing intermediate container f20224728023
Step #0: ---> 6796464e1084
Step #0: Step 23/28 : RUN yes "y" | flutter doctor --android-licenses
Step #0: ---> Running in 7d0bed25e23a
Step #0: Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to resolve this.
Step #0: The command '/bin/sh -c yes "y" | flutter doctor --android-licenses' returned a non-zero code: 1
Finished Step #0
ERROR
ERROR: build step 0 "docker:stable" failed: step exited with non-zero status: 1
Step #0:
--------------------------------------------------------------------------------------------------------------------------------------------------------------
ERROR: (gcloud.builds.submit) build b3291ea8-f7f1-468a-8463-cda2c8d2391c completed with status "FAILURE"
```
Contributor guide
Research direction
Reproduce the failure using the affected gcr.io/cloud-builders-community/flutter image and the shown gcloud builds submit --config cloudbuild.yaml . command. Start with the Docker build step running flutter doctor --android-licenses and verify that the completed image can locate sdkmanager and process Android license acceptance without the reported errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, docker, google-cloud
- Domain
- build-system, cloud, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100