You have not accepted the license agreements of the following SDK component

Hi,

I’m trying to build my app with Ionic Cloud. Building it locally with cordova CLI works, but the Ionic Cloud build is always failing. This is the build 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:
  [Android SDK Platform 24].
  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

Total time: 0.867 secs
Failed to install 'cordova-plugin-device':Error: /home/package/workspace/apps-d0890ab6-26/cordova/platforms/android/gradlew: Command failed with exit code 1
    at ChildProcess.whenDone (/home/package/workspace/apps-d0890ab6-26/cordova/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:829:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
Error: /home/package/workspace/apps-xxxxxxxx-26/cordova/platforms/android/gradlew: Command failed with exit code 1

What am I doing wrong?

5 Likes

Hi @womo

This sounds like an issue in ionic cloud. Did you try to set your targetSdkVersion to 23? Of course, this is only an option if you do not utilize features from v24. :slight_smile:

If you want to specify the SDK version you can do so by adding the following line to your config.xml

<preference name="android-targetSdkVersion" value="23"/>
4 Likes

I had the same issue, to solve follow this SO answer.

4 Likes

This may apply for local builds, but is not a solution for my issue
which occured with Ionic Cloud.

Den 18. nov. 2016 15:02, skrev Fiznool:

fiznool https://forum.ionicframework.com/users/fiznool
November 18

I had the same issue, to solve follow this SO answer
http://stackoverflow.com/a/40383457/1171775.


Visit Topic
https://forum.ionicframework.com/t/you-have-not-accepted-the-license-agreements-of-the-following-sdk-component/69570/3
or reply to this email to respond.

To unsubscribe from these emails, click here
https://forum.ionicframework.com/email/unsubscribe/945ccff2402e73fbc61fb33fc8af8257f4281edc7d08e0bf90049782f1e3c985.

1 Like

try this in your Terminal on Mac
android update sdk --no-ui --filter build-tools-24.0.0,android-24,extra-android-m2repository

Solved it for me

12 Likes

This solved the problem to me, thanks @romanrast :slight_smile:

4 Likes

thanks a lot @portapipe :slight_smile:

Hi everyone,so after racking my brain,I found that the first place to check is your environment variables to check the Android Home path. From there on,follow it and update SDK’s needed in your SDK manager. What my issue was: I had a previous version of android studio I deleted,so my path for the new one was different and I also had embarcadero as well in another path,so I was updating in one SDK manager but Ionic 2 was using the other one where I had not updated and accepted the licenses. If you have the same issues,just copy the new files in both paths so they are mirrored. Just my 2 cents. Hope this helps someone else.

first run platform rm android then again add android platform like platform add android this solution work for case you just try this may this will help you

Error: /Users/XXXX/Projects/XXXX/fe/platforms/android/gradlew: 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:
[Android SDK Platform 25].
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 Exporting licenses - Android Studio Project Site

This worked for me for the SDK License Issue
android update sdk --no-ui --filter build-tools-25.0.0,android-25,extra-android-m2repository

For more: cordova - Can't accept license agreement Android SDK Platform 24 - Stack Overflow

3 Likes

Thank you @rafialikhan this work for me too:

android update sdk --no-ui --filter build-tools-25.0.0,android-25,extra-android-m2repository
1 Like

it’s worked for me, tks alot

You can also just execute

$ANDROID_HOME/tools/bin/sdkmanager --licenses
17 Likes

This is by far the best solution. Kudos!

The easiest way at 2017 july

The above answer didn’t work on windows, but this did:

“%ANDROID_HOME%\tools\bin\sdkmanager” --update

NB: This prompted to accept the SDK license straight away, and the build worked from there.

6 Likes

this is the best solution :smile: thank you

  1. open android studio
  2. open sdk manager
  3. update android api 25
    problem solved for me
3 Likes

Did you find a solution yet? Same problem here. Can’t change anything locally. It’s the cloud building service https://dashboard.ionicjs.com/

I’m getting unknown argument --licenses