I saw that this question has been posted numerous times on this website but also others. There seems to be a broad problem with accepting the licenses in Android. And currently this is witholding me in using CircleCI.
This is how the first part of my .yaml config looks like:
version: 2.0
defaults: &defaults
docker:
- image: circleci/android:api-27-alpha
working_directory: ~/ninetydays
environment:
_JAVA_OPTIONS: "-Xmx1400m"
TERM: dumb
update_sdk: &update_sdk
name: Update SDK
command: |
mkdir -p "$ANDROID_HOME/licenses" || true
rsync -avhP ./android-licenses/ "$ANDROID_HOME/licenses/"
jobs:
build:
<<: *defaults
steps:
- run:
<<: *update_sdk
- checkout
I got a directory in my project with the latest hashes of the licenses for Android. But even though I copy them to the license directory I still get the following error:
Checking the license for package Android SDK Build-Tools 26.0.2 in /usr/local/android-sdk-
linux/licenses
Warning: License for package Android SDK Build-Tools 26.0.2 not accepted.
Checking the license for package Android SDK Platform 27 in /usr/local/android-sdk-linux/licenses
Warning: License for package Android SDK Platform 27 not accepted.
* 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.2, Android SDK Platform 27].
I’ve also tried the following update_sdk command:
update_sdk: &update_sdk
name: Update SDK
command: |
mkdir -p "$ANDROID_HOME/licenses" ||
echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_SDK/licenses/android-sdk-license"
echo -e "\nd56f5187479451eabf01fb78af6dfcb131a6481e" >> "$ANDROID_SDK/licenses/android- sdk-license"
echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" >>"$ANDROID_SDK/licenses/android-sdk-preview-license"
sdkmanager "platform-tools" "platforms;android-27"
But this ain’t working either, anyone has any idea how to solve this?