Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic build error : You have not accepted the license agreements of the following SDK components: [Android SDK Platform 24]

I'm trying to run the command ionic build android --release to build the apk but i am getting this error

Total time: 1.767 secs 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: [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. Picked up _JAVA_OPTIONS: -Xmx512M

like image 509
Amit Singh Avatar asked Nov 03 '16 01:11

Amit Singh


People also ask

How do I accept my SDK license agreement?

Open a terminal 2. Write: "cd $ANDROID_HOME/tools/bin (this path can be /home/your-user/Android/Sdk/tools/bin)" 3. Write: "./sdkmanager --licenses" 4. To accept All licenses listed, write: "y" 5.

What is Android SDK license?

SDK License from Google 3.1 Subject to the terms of the License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use the SDK solely to develop applications for compatible implementations of Android.

How do I install the latest Android SDK?

Install the SDKClick Tools > SDK Manager. In the SDK Platforms tab, select Android 12. In the SDK Tools tab, select Android SDK Build-Tools 31. Click OK to install the SDK.


1 Answers

Install the license:

mkdir "%ANDROID_HOME%\licenses"

echo |set /p="8933bad161af4178b1185d1a37fbf41ea5269c55" > "%ANDROID_HOME%\licenses\android-sdk-license"

like image 87
Peter.Wang Avatar answered Oct 26 '22 19:10

Peter.Wang