Elliott Weeks
Elliott Weeks

Reputation: 83

Failed to install the following Android SDK packages as some licences have not been accepted on aws instance triggered by jenkins

I'm setting up a new Jenkins build for an android app to run tests. I have downloaded android tools on the AWS instance. Then run the following commands to install additional packages to install platforms and build tools.

./android update sdk --no-ui --filter build-tools-28.0.3,android-28,extra-android-m2repository./android update sdk --no-ui --filter build-tools-28.0.3,android-28,extra-android-m2repository

This downloaded the correct platform and build-tools.

To build the app I run gradlew :app:assembleDebug and i'm met with the following error

A problem occurred configuring project ':app'.

Failed to install the following Android SDK packages as some licences have not been accepted. build-tools;28.0.3 Android SDK Build-Tools 28.0.3

I have tried updating the licenses via the sdkmanager with the following commands -

yes | ./sdkmanager --licenses && ./sdkmanager --update

and

./sdkmanager "build-tools;28.0.3"

I am then met with All SDK package licenses accepted.However, when I attempt to build again I get

Failed to install the following Android SDK packages as some licences have not been accepted. build-tools;28.0.3 Android SDK Build-Tools 28.0.3

I have also changed the permissions on the folder structure using chmod 777

Upvotes: 0

Views: 3984

Answers (1)

JRichardsz
JRichardsz

Reputation: 16515

When I build and apk I don't need to accept the licenses every time, just one time before my Jenkins configuration.

I did it with this steps:

  • Go to your $ANDROID_HOME/tools/bin
  • Execute:
    ./sdkmanager --licenses

Without "yes |"

This will ask you to accept or reject licenses. You must accept all licenses.

Next time when you run build commands, licenses will not a problem.

Check this link to get a full guide of Android automated builds:

https://jrichardsz.github.io/android/how-configure-android-tools-for-automated-builds

Upvotes: 1

Related Questions