Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You have not accepted the license agreements of the following SDK components: [Google Repository]. #1726

Closed
muzammilahmed opened this issue Nov 26, 2016 · 28 comments

Comments

@muzammilahmed
Copy link

muzammilahmed commented Nov 26, 2016

I'm using cordova push plugin plugin for push notifications I've installed google repository and google play services packages from android SDK manager., but when ever I execute ionic build android to create build its gives me following error.

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 13.856 secs

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

You have not accepted the license agreements of the following SDK components:
[Google Repository].
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

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

Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

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

You have not accepted the license agreements of the following SDK components:
[Google Repository].
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

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
@Fenmingyu
Copy link

Fenmingyu commented Nov 28, 2016

I also encountered this problem today.
Please help me If you solved this problem.
Thanks

@IgorGanapolsky
Copy link

Did you find a solution to this problem? I am facing a similar issue.

@smitthakkar96
Copy link

smitthakkar96 commented Nov 29, 2016

I found the fix it's because there are two missing packages called google repository and android repository. You can go to android sdk manager by android sdk command and navigate to extras folder there you can select both packages and install them. The issue will be resolved.

@IgorGanapolsky
Copy link

@smitthakkar96 Those licenses should have already been downloaded to android-sdk-home/licenses directory.

@smitthakkar96
Copy link

@IgorGanapolsky No those aren't, they are really large packages. Can you please put effort to check whether Google Repository Package is installed or not.

@esase
Copy link

esase commented Nov 30, 2016

I solved this problem just installed these components in "Android 7.0 (API 24)":
SDK platform
Google Apis
Sources for android SDK

@ksummersill
Copy link

Thank you esase for posting this. I even installed the 7.1.1 (API 25) but no luck. I installed just the SDK platform, Google APIs, and Sources for Android SDK; the build was successful.

@killerbytes
Copy link

Take note which API level and install that version

@Jojr
Copy link

Jojr commented Dec 17, 2016

@ksummersill You need to install the "Android 7.0 (API 24)" and not "Android 7.1.1 (API 25).

@BattleToads
Copy link

Configure > SDK Manager > Launch Standalone SDK Manager

@gbrits
Copy link

gbrits commented Feb 11, 2017

You will run into an issue like this whenever your Android Studio's packages are outdated, as building will occur in the latest stable releases. To fix, do the following:

Android Studio > Preferences > Appearance & Behavior > System Settings > Android SDK
Tick the latest Android versions, click Apply.
It's at this point where Android will ask you to agree to its license(s) and the updated version(s) will be installed. Now you can Ionic / Cordova / PhoneGap build / run.

@RafatAssaf
Copy link

I just checked for updates in Android studio settings, installed them, and the problems was solved.

@raghulrajnkl
Copy link

Update the your android gradle, its working fine

@SKempin
Copy link

SKempin commented Nov 7, 2017

@gbrits
I'm still getting the following error after installing the latest SDK's. Any advice? Thanks!

Checking the license for package Google Repository in /usr/local/Caskroom/android-sdk/3859397,26.0.1/licenses
Warning: License for package Google Repository not accepted.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> You have not accepted the license agreements of the following SDK components:
  [Google Repository].
  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

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

screen shot 2017-11-07 at 23 20 17

screen shot 2017-11-07 at 23 20 03

@amed
Copy link

amed commented Nov 13, 2017

@SKempin
Just run $ $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-26" and accept it.

@DeepzSandra
Copy link

I'm still getting the following error after installing the latest SDK's. Any advice? Thanks!

Checking the license for package Google Repository in /usr/local/Caskroom/android-sdk/3859397,26.0.1/licenses
Warning: License for package Google Repository not accepted.

FAILURE: Build failed with an exception.

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

You have not accepted the license agreements of the following SDK components:
[Google Repository].
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

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

BUILD FAILED

@imhoffd
Copy link
Contributor

imhoffd commented Dec 16, 2017

The solution for Android Studio is here -> #1726 (comment)

The solution for Android SDK (stand-alone) is here -> #1726 (comment)

I'll expand on the latter a bit.

First, make sure you have the latest Android SDK installed.
Second, make sure ANDROID_HOME is set. (echo $ANDROID_HOME)

📝 If the ANDROID_HOME environment variable is not set, take a look at this guide: https://spring.io/guides/gs/android/#android-dev-env

These commands may need slight tweaking for Windows:

cd $ANDROID_HOME 
./tools/bin/sdkmanager --licenses

The sdk manager utility will walk you through licenses which need accepting.

@imhoffd imhoffd closed this as completed Dec 16, 2017
@chingwen823
Copy link

check Google APIs 23.0.1 up in Android studio
accept all license with sdkmanager --license

and the bug gone.

@renjithspace
Copy link

renjithspace commented May 30, 2018

You can simply solve that. Please open platforms/android in Android studio. Then it shows the same error in Build log as an error. There you can find the link to the missing agreement. You can simply click it to download and accept.

@andreszs
Copy link

If you are using the Android SDK Manager GUI and license is still rejected, try this which worked for me:

  • Remove the platforms\android-26 folder.
  • Run sdkmanager "platforms;android-26" in the android-sdk\bin folder.
  • Press y to accept the license and wait until it's installed.

@joese6
Copy link

joese6 commented Jul 20, 2018

Open the "sdkmanager.bat --update" via command line then select "Y" , enter and wait until finish.
as and example, I use the command line to enter the directory : "E:\android-sdk_r24.4.1-windows\android-sdk-windows\tools\bin"
then i type : sdkmanager.bat --update

I hope this helps.

@s2zaman
Copy link

s2zaman commented Jul 24, 2018

My $ANDROID_HOME was set to sdk-root-directory/tools/bin

I Updated the $ANDROID_HOME to its correct path sdk-root-directory
and added to PATH as $ANDROID_HOME/tools/bin
:)

@joese6
Copy link

joese6 commented Jul 24, 2018

screenshot_68
I added this : E:\android-sdk_r24.4.1-windows\android-sdk-windows\tools;E:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools

then, in command line i type : sdkmanager.bat --update .

@hvsombrilla
Copy link

If the problem persists you can try reinstalling the platform

ionic cordova platform rm android
ionic cordova platform add android

@lukdeboss
Copy link

actually you can just go to cmd
find where you have SDK installed and cd to tools/bin
execute in exmaple:
./sdkmanager "platforms;android-26"
and accept license with y

@SnehalAgrawal
Copy link

You can face this problem if you have installed the SDK but have not accepted the license agreement.
To solve this problem you just need to accept the terms and conditions of the SDK component. To accept the terms and conditions you can use a command line tool sdkmanager.
You can solve the issue in 2 steps:

  1. Go to SDK -> tool -> bin using the following command
    cd C:\Users\Admin\AppData\Local\Android\Sdk\tools\bin
  2. Run the following command to ask for licenses acceptance
    sdkmanager --licenses

you_have_not_accepted_the_license_agreements_of_the_following_sdk_components2

If anybody still facing the issue then please follow the link for the solution
https://aboutreact.com/you-have-not-accepted-the-license-agreements-of-the-following-sdk-components/

@ayoubkhan558-zz

This comment has been minimized.

@imhoffd
Copy link
Contributor

imhoffd commented Jul 10, 2019

For those coming to this issue now...

The solution is here 👉 #1726 (comment)

(make sure all required packages are installed first by following our Android Setup docs, making sure you also install an SDK Platform fully)

If you don't use Android Studio, here's what you have to do: #1726 (comment)

@ionic-team ionic-team locked and limited conversation to collaborators Jul 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests