0

I coded an ionic 2 app and I have tried to run "ionic run android" to build the apk. I keep getting and error. I have tried everything. I came across this question below but as a newbie I truly can for the life of me figure out what I need to do.

Automatically accept all SDK licences

please help.

ERROR LOOKS LIKE THIS

BUILD FAILED

Total time: 1.903 secs

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.

Error: cmd: Command failed with exit code 1 Error output:

Community
  • 1
  • 1
Tian Reagon
  • 118
  • 2
  • 11

1 Answers1

0

Try the following steps:

-Open your terminal and type the following command. on windows make sure you open your command line as administrator

android

-Android SDK Manager should open, If not then you need to fix your sdk path or environment variables.

-Next to the Tab Android 7.0 (API 24) select it FYI(You do not need to download everything only SDK Platform)

enter image description here

-Now you need to download the SDK, Click on Install Packages.... on the bottom right corner

enter image description here

-Once clicked a modal should open. First click on Android SDK License and make sure it is highlighted.

enter image description here

-You should now be given the option to Accept the License, which you can do by clicking on the radio button on the bottom right corner

enter image description here

-Once done you can click the Install button , It may take a while so go outside and stare at the sun.

-I tend to restart my computer or terminal afterwords which makes sure everyone knows there's a new SDK but its not required.

LeRoy
  • 4,189
  • 2
  • 35
  • 46