Rafael Hernández
Rafael Hernández

Reputation: 364

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

I have this error aobut accept the sdk license agreements

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> 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
  
  Using Android SDK: /usr/lib/android-sdk

I have two android-sdk

one in /usr/lib/android-sdk and the other in home/bug/Android/Sdk

 yes | $ANDROID_SDK_ROOT/tools/bin/sdkmanager "build-tools;29.0.2"
Warning: File /home/bug/.android/repositories.cfg could not be loaded.          
[=======================================] 100% Computing updates...

with this command I accept in home/bug/Android------

but How to accept the license in /usr/lib/android-sdk????

Upvotes: 0

Views: 597

Answers (2)

Rafael Hernández
Rafael Hernández

Reputation: 364

I fixed the problem copying the licenses into /usr/lib/android-sdk

sudo cp -R licenses /usr/lib/android-sdk

Upvotes: 1

madlymad
madlymad

Reputation: 6530

You can use

yes |  /usr/lib/android-sdk/tools/bin/sdkmanager --licenses

I am not sure but you may also require to create the repositories.cfg file:

mkdir ~/.android
echo "count=0" > ~/.android/repositories.cfg

Upvotes: 1

Related Questions