Jitpack.io: Failed to install the following Android SDK packages as some licences have not been accepted.

Created on 19 Jan 2019  路  67Comments  路  Source: jitpack/jitpack.io

A problem occurred evaluating script.

Failed to install the following Android SDK packages as some licences have not been accepted.
platforms;android-27 Android SDK Platform 27
build-tools;27.0.3 Android SDK Build-Tools 27.0.3
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

Using Android SDK: /opt/android-sdk-linux

Most helpful comment

@avshvetsov I have managed to resolve this by "hacking" around the script by adding command to accept the license. Please refer to this commit that have resolved my build.
This is the log that proves that it has built successfully.

Basically, you add one line of code at your project file graldew with the following code

yes | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;28.0.3"

All 67 comments

I have the same problem when trying to publish my own android library to jitpack. It was working fine just yesterday. But now it suddenly give me an error message:

 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
     platforms;android-28 Android SDK Platform 28

I rebuilt my library and updated the version several times but still no use. Is it something wrong with the jitpack server?

Seeing as there are three other issues right before this one about the same problem, I'd say it's probably something up with the build servers.

https://github.com/jitpack/jitpack.io/issues/3686
https://github.com/jitpack/jitpack.io/issues/3685
https://github.com/jitpack/jitpack.io/issues/3684

I had the same problem.

I have same issue!:|

`* What went wrong:
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
platforms;android-28 Android SDK Platform 28
`

I had the same problem too!

anyone resolve the problem?

The same with me

Anyone resolve this issue?

@avshvetsov I have managed to resolve this by "hacking" around the script by adding command to accept the license. Please refer to this commit that have resolved my build.
This is the log that proves that it has built successfully.

Basically, you add one line of code at your project file graldew with the following code

yes | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;28.0.3"

@avshvetsov

Thanks!!!

yes | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-28"

yes | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;27.0.3"

worked for me on gradlew

I have a safer solution. First of all, put this in jitpack.yml and not in gradlew -- so it will only affect JitPack and not others that happen to run your build.
Second, instead of explicitly installing the components, just tell Android you accepted the license.

Step one

Copy this gist to some server you control (GitHub pages is a great option and so is a Gist):
https://gist.github.com/noamtamim/b04ef67239d2b43638aa5a9a024a1937

Step two

Create jitpack.yml (if you don't have one already) in the root of the repo:

before_install:
  - curl URL_OF_THE_FILE | sh

Example:

before_install:
  - curl https://gist.githubusercontent.com/noamtamim/b04ef67239d2b43638aa5a9a024a1937/raw/56f1a38dd88a3774b71a063822444f3961d61873/android-sdk-license.sh | sh

Make sure the URL is to the RAW file.
But please copy this to your own account/gist/server. Every time there's an updated license, update this file with the new license hash.
Legally if you run this script (or your own version of it), it means you accepted the license.
See here for more info: https://developer.android.com/studio/intro/update#download-with-gradle

Hi all,

Should be fixed now. Thanks for the workarounds!

Hi, seems not fixed yet

Build starting... Start: Mon Jan 21 13:36:13 UTC 2019 7ad8e0ad4e6c

...

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 platforms;android-28 Android SDK Platform 28

Anyway thanks for addressing this issue!

seems to be fixed already, thanks :)

@jitpack-io
not all problems are resolved:
https://jitpack.io/com/github/avshvetsov/FastScroll/6ca6585d5a/build.log

Can you help?

It is not working for me either
https://jitpack.io/com/github/goui/testlib/0.1.4/build.log

I have added the 2 lines at the end of my gradlew.
Thing is, even without those lines the ./gradlew install was working for me locally.

I think you might have a problem with your CI not accepting the licenses.

@jitpack-io
https://jitpack.io/com/github/silencedut/diffadapter/1.2.0/build.log
still not be resolved in my project

@SilenceDut Rebuilt v1.2.0

Still not working for me :/
https://jitpack.io/com/github/inmobly/boltplay/1.0.18/build.log

@oahmedazab did you try my workaround? It's very easy to implement. See https://github.com/jitpack/jitpack.io/issues/3687#issuecomment-455901608.

Still not working for me ,but when i restart android studio it(the bug) disappear!

Small clarification on how this works:
JitPack will try to read your build.gradle to find SDK and build-tools version. It will then install those versions. If you are using properties in your build.gradle, like this:

    compileSdkVersion rootProject.ext.android["compileSdkVersion"]
    buildToolsVersion rootProject.ext.android["buildToolsVersion"]

then JitPack is unable to detect those versions (yet).

For now we recommend using versions directly in build.gradle like this:

    compileSdkVersion "28"
    buildToolsVersion "28.0.3"

Nope the morons who decided to remove the --licenses option have no clue what they are doing. I am still getting that same error myself. It has to do with 28.0.3

I can't complete this bloody project now. Thanks android!

Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use --status for details

Configure project :app
Checking the license for package Android SDK Build-Tools 28.0.3 in E:android-sdk\licenses
Warning: License for package Android SDK Build-Tools 28.0.3 not accepted.
Checking the license for package Android SDK Platform 27 in E:android-sdk\licenses
Warning: License for package Android SDK Platform 27 not accepted.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':app'.

    Failed to install the following Android SDK packages as some licences have not been accepted.
    platforms;android-27 Android SDK Platform 27
    build-tools;28.0.3 Android SDK Build-Tools 28.0.3
    To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
    Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

    Using Android SDK: E:android-sdk

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 11s

@Sangra69 Even though it seems to be working according to user feedback (I'm a JitPack user, not staff), have you tried the workaround I suggested here?
https://github.com/jitpack/jitpack.io/issues/3687#issuecomment-455901608

Hi,I have the same problem, and I solved this problem by this way锛宮y system is window10锛宎nd IDE is Android studio.

https://stackoverflow.com/questions/39760172/you-have-not-accepted-the-license-agreements-of-the-following-sdk-components/43003932#43003932?newreg=73869e982bcb4fa88fd8a1028649563d

Still not working for me ,but when i restart android studio it(the bug) disappear!

This -- interestingly -- fixed my problem too...

Greetings!
Run the following command on the Terminal as administrator

flutter doctor --android-licenses

It should count the number of licenses that you have not accepted and then ask you for a review
press Y and then accept all the licenses you need.

I hope it helps, have a nice happy coding hours!
Cheers!!!

I downloaded build tools and SDK using Android Studio.

Hope this helps for anyone.

Small clarification on how this works:
JitPack will try to read your build.gradle to find SDK and build-tools version. It will then install those versions. If you are using properties in your build.gradle, like this:

    compileSdkVersion rootProject.ext.android["compileSdkVersion"]
    buildToolsVersion rootProject.ext.android["buildToolsVersion"]

then JitPack is unable to detect those versions (yet).

For now we recommend using versions directly in build.gradle like this:

    compileSdkVersion "28"
    buildToolsVersion "28.0.3"

This Solved My Problem , Thank You

Fixed when I changed the bitbucket-pipelines.yml file. I've added a second licence value, because I had only one. You can check the values on your local machine in $ANDROID_HOME/licenses folder.

The line I changed.
- echo -e "\nd56f5187479451eabf01fb78af6dfcb131a6481e \n24333f8a63b6825ea9c5514f83c2829b004d1fee" > "$ANDROID_HOME/licenses/android-sdk-license"

Yml file changes.
image

Licence files on the local machine.
image

Just open SDK Manager in Android Studio and install SDK version 28(Android Pie)

locate toolsbin in your cmd then type sdkmanager --licenses.
if it says that all licenses are accepted but then youre still encountering the issue.
try to restart your computer and rebuild again.

locate toolsbin in your cmd then type sdkmanager --licenses.
if it says that all licenses are accepted but then youre still encountering the issue.
try to restart your computer and rebuild again.

$ANDROID_HOME/tools/bin/sdkmanager --licenses
that is work for me

For me it was just that my project was on an external hard drive and forgot to plug it in. So check it if thats the case!

Hi,I have the same problem, and I solved this problem by this way锛宮y system is window10锛宎nd IDE is Android studio.

https://stackoverflow.com/questions/39760172/you-have-not-accepted-the-license-agreements-of-the-following-sdk-components/43003932#43003932?newreg=73869e982bcb4fa88fd8a1028649563d

thank you, this actually works

Hey!!!

Just open terminal or git bash and head over to your android studio directory. Command Terminal is recommended for Windows users.

For windows users:
cd C:\Users\{USERNAME}\AppData\Local\Android\Sdk\tools\bin

and then run this to accept unaccepted licenses.
sdkmanager.bat --licenses

and then just review and accept them by typing 'y' and hit enter till its done..

Reference:

https://www.youtube.com/watch?v=c7HmwiTtYPE&t=580s

@aveenashmandhwani Worked like a charm! Thanks a lot for sharing. (on macOS just open /usr/local/share/android-sdk on your terminal)

run command in cmd: flutter doctor --android-licenses

Just install tools as per the attached image in AndroidSDK >> SDK Tools it will work. For me "Google Play Licensing Library" was missing.

image

~/Library/Android/sdk/tools/bin
./sdkmanager --licenses

just this

just install ur android studio update...

all what you need is to install them manually by the sdk-manager tool,

anyone can assist me on this? i have no clue what sdkmanager is. im trying to call "cordova build android" and this error message popped. how do i solve this given that i have android studio already

locate toolsbin in your cmd then type sdkmanager --licenses.
if it says that all licenses are accepted but then youre still encountering the issue.
try to restart your computer and rebuild again.

$ANDROID_HOME/tools/bin/sdkmanager --licenses
that is work for me

That is work for me, Tks!

anyone can assist me on this? i have no clue what sdkmanager is. im trying to call "cordova build android" and this error message popped. how do i solve this given that i have android studio already

Install Android Studio, on Welcome to Android Studio Screen on the right bottom you will see Configure, there choose SDK Manager ---> Appearance & Behavior --> System Settings --> Android SDK install Android version you gonna use maybe from 8.0 to latest..

This did the trick for me with Ionic 4 Cordova

run the flutter console.Use the command "flutter doctor" and you gonna find the problem.This work for me.

Android Studio: Appearance & Behavior/System Settings/Android sdk/SDK Update Sites
check checkbox Force https://... sources to be fetched using http://
try run again and don't forget to check any other third party you need.

You have just to install android sdk 27
TOOLS -> SDK MANAGER -> android 8.1 with api level 27 -> apply
build a second time, It will works !!

In Android Studio 3.6 or later, you need to manually add the old version of the Android SDK Tools for Flutter to work. To do this:
Open the Android Studio SDK Manager
In the Android SDK tab, uncheck Hide Obsolete Packages
Check Android SDK Tools (Obsolete)
and install.

Greetings!
Run the following command on the Terminal as administrator

flutter doctor --android-licenses

It should count the number of licenses that you have not accepted and then ask you for a review
press Y and then accept all the licenses you need.

I hope it helps, have a nice happy coding hours!
Cheers!!!

it worked me

Greetings!
Run the following command on the Terminal as administrator

flutter doctor --android-licenses

It should count the number of licenses that you have not accepted and then ask you for a review
press Y and then accept all the licenses you need.

I hope it helps, have a nice happy coding hours!
Cheers!!!

woked for me, thanks!

Similaar issue here when running builds on Travis CI for Android.

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

隆隆隆Oye!!!

S贸lo tiene que abrir terminal o git bash y dirigirse a su directorio de estudio Android. Command Terminal se recomienda para usuarios de Windows.

Para usuarios de Windows:
cd C:\Users\{USERNAME}\AppData\Local\Android\Sdk\tools\bin

y luego ejecutar esto para aceptar licencias no aceptadas.
sdkmanager.bat --licenses

y luego simplemente revisar y aceptarlos escribiendo 'y' y pulse enter hasta que est茅 hecho..

Referencia:

https://www.youtube.com/watch?v=c7HmwiTtYPE&t=580s

Good

ubuntu 18.04 (SOLVED)

Run

flutter doctor --android-licenses

my solution
android update sdk --no-ui --all --filter build-tools-28.0.3,android-28,extra-android-m2repository

i have the same problem, and i switch my jdk into jdk8 following this guide https://dev.to/thegroo/install-and-manage-multiple-java-versions-on-linux-using-alternatives-5e93 then i run sdkmanager --licenses
then it run smooth
but make sure you have install jdk8 not only jre8
check your java version using java --version, android using java8

try this
open cmd redirect to User\AppData\Local\Android\Sdk\toolsbin> then write sdkmanager.bat --licenses
User\AppData\Local\Android\Sdk\toolsbin>sdkmanager.bat --licenses

I was getting this error when running my Flutter application :
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

Solution:
I tried sdkmanager.bat --licenses and flutter doctor --android-licenses, but it didn't help.
So I manually downloaded the SDK build-tool 29.0.2 and put it inside Android/Sdk/build-tools folder.

I had the same problem. Try typing flutter doctor to cmd and then it will tell you what to do.

@JakubGrzelak00 did you install android studio ?

@samulon13 Yes I did and face this error with first run on project. I'm new to flutter and this is the only working explanation that I found.

this isnt about flutter. this is a common problem when we arent yet familiarize with android studio.

run sdkmanager --licenses in your terminal/cmd and accept licenses.
make sure you are in administrator mode.

sometimes you might also need to reboot your system.

go to in your project and than >build.gradle file ->dependencies->
this was my class path -> classpath("com.android.tools.build:gradle:3.4.2")
This is what i replaced it:
classpath('com.android.tools.build:gradle:3.5.3')
classpath 'com.google.gms:google-services:4.3.4'
upgrade gradle version it will work , this worked for me

I reinstall the build tools and this resolved th problem

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jtang-ml picture jtang-ml  路  4Comments

jitpack-io picture jitpack-io  路  7Comments

jitpack-io picture jitpack-io  路  6Comments

Hala-Nearmotion picture Hala-Nearmotion  路  4Comments

ennru picture ennru  路  4Comments