jitpack / jitpack.io

Documentation and issues of https://jitpack.io
MIT License
2.54k stars 185 forks source link

Failed to install the following Android SDK packages as some licences have not been accepted. #3687

Closed ashLikun closed 2 years ago

ashLikun commented 5 years ago

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

hal0360 commented 5 years ago

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?

zacharee commented 5 years ago

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

look0089 commented 5 years ago

I had the same problem.

HamidrezaAmz commented 5 years ago

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 `

RX1226 commented 5 years ago

I had the same problem too!

sicmu commented 5 years ago

anyone resolve the problem?

Hackforid commented 5 years ago

The same with me

avshvetsov commented 5 years ago

Anyone resolve this issue?

TonyTangAndroid commented 5 years ago

@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"

giladna commented 5 years ago

@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

noamtamim commented 5 years ago

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

jitpack-io commented 5 years ago

Hi all,

Should be fixed now. Thanks for the workarounds!

masako-yamada commented 5 years ago

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!

tibbi commented 5 years ago

seems to be fixed already, thanks :)

avshvetsov commented 5 years ago

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

Can you help?

goui commented 5 years ago

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.

SilenceDut commented 5 years ago

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

jitpack-io commented 5 years ago

@SilenceDut Rebuilt v1.2.0

oahmedazab commented 5 years ago

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

noamtamim commented 5 years ago

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.

parcool commented 5 years ago

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

jitpack-io commented 5 years ago

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"
Sangra69 commented 5 years ago

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.

BUILD FAILED in 11s

noamtamim commented 5 years ago

@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

huazaihuola commented 5 years ago

Hi,I have the same problem, and I solved this problem by this way,my system is window10,and 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

tarikguney commented 5 years ago

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

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

guplab commented 5 years ago

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!!!

jbethuel commented 5 years ago

I downloaded build tools and SDK using Android Studio.

Hope this helps for anyone.

mjmichael73 commented 5 years ago

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

Kravet commented 5 years ago

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

outZoNe commented 5 years ago

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

GnApollo commented 5 years ago

locate tools\bin 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.

usmanantharikta commented 5 years ago

locate tools\bin 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

chrisMiller2 commented 5 years ago

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!

pavoltravnik commented 5 years ago

Hi,I have the same problem, and I solved this problem by this way,my system is window10,and 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

aveenash-mandy commented 5 years ago

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

httpedrao commented 5 years ago

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

marciosarabando commented 5 years ago

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

ankitbhatia87 commented 5 years ago

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

image

leandrocastro commented 4 years ago

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

just this

webismail92 commented 4 years ago

just install ur android studio update...

al3ra8e628 commented 4 years ago

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

jeffrey-coder commented 4 years ago

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

MichaelRSilva commented 4 years ago

locate tools\bin 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!

DanFast commented 4 years ago

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

caiobraga98 commented 4 years ago

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

pimol commented 4 years ago

https://github.com/jitpack/jitpack.io/issues/3684 closed for me.

tonymedrano commented 4 years ago

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.

zoubir-remila commented 4 years ago

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 !!

demolagiran commented 4 years ago

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.