Today new builds seem to be failing on acceptance of License Agreements.
Warning: License for package Android SDK Build-Tools 26.0.3 not accepted.
Checking the license for package Android SDK Platform 26 in /opt/android/sdk/licenses
Warning: License for package Android SDK Platform 26 not accepted.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> You have not accepted the license agreements of the following SDK components:
[Android SDK Build-Tools 26.0.3, Android SDK Platform 26].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
Having the same issue. This is using the api-27-alpha docker image for reference.
According to the URL the message provides, it appears that we need to add a license folder to where the Android SDK manager lives on the build machine in order to allow the SDK manager to download the appropriate libraries.
I also had this problem I fixed by getting the licenses from my local development machine in $HOME/Library/Android/sdk/licenses on OSX. I added them to git and copy them in my build for now.
Thanks @KyleTryon. I didn’t realize we have non alpha versions available. Is alpha meant to be a “canary” build or they legacy when moving over to docker images?
Also for future reference, I added a new step & command to my circle.yml file which approves all Android SDK licenses:
yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses || if [ $? -ne '141' ]; then exit $?; fi; #Captures SIGPIPE 141 error but still allow repeating "y" to accept all licenses
Since CircleCi captures pipe errors, that if statements captures the 141 error that occurs. All other errors are reported. error 141 occurs when sending input to a command that no longer exists.
This works on the same docker image as before. No additional changes were necessary.