Since gradle android plugins 2.2-alpha4:
Gradle will attempt to download missing SDK packages that a project depends on
Which
This path has been changed in the recent versions.
./sdkmanager
is now in /Library/Android/sdk/cmdline-tools/latest/bin
and then just do
./sdkmanager --licenses
If you use tools/bin/sdkmanager --licenses
you still need to have a human interaction. I have the problem using my gitlab CI. This is my solution:
wget --quiet --output-document=tools.zip https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
unzip -qq tools.zip
echo y | tools/bin/sdkmanager "platforms;android-25"
echo y | tools/bin/sdkmanager "platform-tools"
echo y | tools/bin/sdkmanager "build-tools;25.0.2"
echo y | tools/bin/sdkmanager "extras;android;m2repository"
echo y | tools/bin/sdkmanager "extras;google;m2repository"
echo y
will say yes if there is any question, but you need to make one line per installe package
In Windows PowerShell, you can do
for($i=0;$i -lt 30;$i++) { $response += "y`n"}; $response | sdkmanager --licenses
This is much more flexible and requires zero manual intervention. The 30 number is arbitrary, should be enough to cover the number of license acceptances, but can be increased if needed
I solved this problem by creating a public git repo with the accepted license files. Then I use wget
to fetch these licenses on any machine I need into a [sdk-dir]/licenses directory before running ./gradlew to build my project.
I tried all the above command on windows 10 machine but the solution was to use the SDKMANAGER to check and accept licenses buy installing missing versions
I had same issue but none of the answers posted helped since there was no tools
folder present in Library/Android/sdk.
(I'm using Android 3.6.3 on Mac OS 10.14.4)
Below steps helped me to overcome licensing problem error:
Android Studio
cmd + shift + A
. This opens Actions
pop-up window.SDK Manager
and hit enter to open.Android SDK
. Select some other version of Android apart from already installed one. (In my case Android 10.0 was already installed so I selected Android 9.0) Apply
button. This will install corresponding SDK.