When trying to generate a signed SDK, I receive an error message:
" Failed to install the following Android SDK packages as some licences have not been accepted. build-tools;29.0.2 Android SDK Build-Tools 29.0.2 To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager. "
As instructed, I started the SDK Manager, but I do not find where I can accept the SDK license agreements or install missing components. I see that some components can be updated, but I fail to find how to do that.
My Android studio 4.1.2 runs under Windows 10 home 64bit. To be able to generate signed SDK, I chose Android 9.0 (Pie) API level 28
You need to accept the licences before building.
According to Android SDK documentation you can use the following command depending on the sdkmanager location: Docs on --licenses option seems to be missing though.
%ANDROID_HOME%/tools/bin/sdkmanager --licenses
Related
I just installed Android Studio on a new device and during my first project I get this error:
License for package Android SDK Build-Tools 30.0.2 not accepted.
Please, what should I do?
In Android Studio:
Go to Tools -> SDK Manager
Select Android SDK and then the SDK Tools tab
Mark the Google Play Licensing Library and click on OK to install it
Now your error should be all gone, if not, restart your Android Studio.
I got exactly same error on Windows 10 but above solution didn't work for me. As this error was specially pointing towards 30.0.2, I checked in Android Studio under Tools>>SDK Manager>> SDK Platforms and found that only latest Android 12.0(S) with API level 31 was installed. I checked Android 11.0(R) to install API level 30 and error got resolved.
Screenshot for solution
For Linux
Go to Android\sdk\tools\bin
yes | sdkmanager --licenses
For MacOS
yes | sudo ~/Library/Android/sdk/tools/bin/sdkmanager --licenses
For Windows
cmd.exe /C"%ANDROID_HOME%\tools\bin\sdkmanager.bat --licenses"
Make sure that Java is installed before hand
Credits to this answer
I'm getting the following error while trying to run ./gradlew build
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;29.0.2 Android SDK Build-Tools 29.0.2
platforms;android-29 Android SDK Platform 29
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
But when I run ./sdkmanager --licenses I get:
Warning: File /var/jenkins_home/.android/repositories.cfg could not be loaded.
All SDK package licenses accepted.======] 100% Computing updates...
So kinda stupid mistake that I did, I was using the xmartlabs/jenkins-android image which according to its Dockerfile set ANDROID_HOME to /opt/android-sdk-linux. Which was also mentioned in the error, I didn't notice it. Anyways I ended up creating an android sdk in a separate directory, where the license were accepted and so kept getting the unaccepted license agreements' error.
I have Team Foundation Server 2018 Express installed on the same machine as my android studio. My project builds just fine in android studio. But when I try to build it from TFS, I get the error:
2018-06-27T18:07:46.5160178Z FAILURE: Build failed with an exception.
2018-06-27T18:07:46.5250007Z
2018-06-27T18:07:46.5319886Z * What went wrong:
2018-06-27T18:07:46.5374784Z A problem occurred configuring project ':androidhelper'.
2018-06-27T18:07:46.5374784Z > Failed to install the following Android SDK packages as some licences have not been accepted.
2018-06-27T18:07:46.5414710Z platforms;android-26 Android SDK Platform 26
2018-06-27T18:07:46.5444654Z build-tools;27.0.3 Android SDK Build-Tools 27.0.3
2018-06-27T18:07:46.5449640Z To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
2018-06-27T18:07:46.5464600Z Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
2018-06-27T18:07:46.5499548Z
2018-06-27T18:07:46.5514516Z Using Android SDK: C:\Users\CAA\AppData\Local\Android\sdk\platform-tools
After checking in the SDK-Manager of android studio, the packages are, as far as I can tell, all installed:
On other threads I've found that using
sdkmanager --licenses
from command line might solve this issue. But according to the output, everything is accepted:
How do I archive my TFS to build the android project?
Update:
Other things I've tried:
I've deleted the folders of the platform and build tools. In addition I've deleted the content of the licenses folder. After reinstalling everything with the sdkmanager.bat and calling the --licenses option, everything is as it was before.
I've used the sdkmanager UI in android studio to uninstall and install the buildtools and the platform.
installed VS community edition, because i've found cases here on stackoverflow, where that was the solution
ensured that the agent service is running with the my login data
removed the agent service, deleted it entirely and downloaded it fresh.
Try below items to narrow down the issue:
Run below command :
cd $ANDROID_HOME/tools/bin ./sdkmanager --update
%ANDROID_HOME%/tools/bin/sdkmanager --licenses
Remove and install again:
1, Remove the platforms\android-26 folder.
2, Run sdkmanager "platforms;android-26" in the android-sdk\bin
folder.
3, Press y to accept the license and wait until it's installed.
Do the same thing for build-tools;27.0.3 Android SDK Build-Tools 27.0.3
Uninstall and reinstall from SDK-Manager
1, Uninstall the SDK Platform 26 and Build-Tools 27.0.3 and reinstall them again in SDK-Manager
2, Run %ANDROID_HOME%/tools/bin/sdkmanager --licenses and accept all the licenses.
Deploy a new agent on a different machine and install the Android SDK
on it. Try it again.
currently I'm trying to get into NativeScript.
How Ever, running the command:
tns run android
gives me the following error message:
You have not accepted the license agreements of the following SDK components:
[Android SDK Build-Tools 25, Android SDK Platform 25]
I already tried to completely uninstall Android SDK Build-Tools as well as SDK Platform and reinstall it using SDK Manager. It keeps prompting this error.
Can anyone tell me how to get rid of this, or how to accept the license correctly ?
I'm using Windows 10.
I have the same problem... But I solved it by executing the following.
android update sdk --no-ui --filter build-tools-25.0.0,android-25,extra-android-m2repository
I hope to help
Not able to run react native in windows
Checking the license for package Android SDK Build-Tools 23.0.1 in
C:\Users\ASUS\AppData\Local\Android\Sdk\tools\licenses
Warning: License for package Android SDK Build-Tools 23.0.1 not accepted.
Checking the license for package Android SDK Platform 23 in
C:\Users\ASUS\AppData\Local\Android\Sdk\tools\licenses
Warning: License for package Android SDK Platform 23 not accepted.
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
You have not accepted the license agreements of the following SDK components:
[Android SDK Platform 23, Android SDK Build-Tools 23.0.1].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
but i tried add licences forder to sdk path it didnt worked.i update the all of my skd platform and sdk tools.but still im getting this error.how can i fix this.
If you start the Android Studio IDE, it will prompt you to agree to the license agreement. Once you accept, this error should be resolved.
Uninstall the entire Android Studio and reinstall with the latest Android SDK platforms will probably do the trick. Also, please try using the > sdkmanager --licenses command.