Ionic run android not working on v2

BUILD FAILED

Total time: 3.424 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 comp
    lete the installation of the missing components using the Android Studio SDK Man
    ager.
    Alternatively, to learn how to transfer the license agreements from one workstat
    ion to another, go to Exporting licenses - Android Studio Project Site
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.

Did you google your error message before posting here? #1 is a result right here in the forum…

Open Android Studio, accept the lincense agreements, done.

Also: Please edit your post and use the </> button above the post input field to format your code or error message or wrap it in ``` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.

where to accept the lincense agreement in android sdk?

With Android Studio. You can find android sdk manager in there

I use this command

android update sdk --no-ui

@mich356c I already run this command. but in my cmd

‘android’ is not recognized as an internal or external command

this error show

Then you also didn’t correctly install Android SDK.

(Why not just install Android Studio that takes care of all of that?)

2 Likes

To use android in the terminal you need the path configured:

This looks similar to my build error for Android. To solve this, I installed the latest version of Android studio, and let it rebuild the gradle for me. This will also require you to use the SDK manager to install, update, and accept terms of the firmware you are targeting. Don’t forget to ionic platform remove android before building the gradle, and then add the platform after Android Studio does its thing.

Build successfully launch…:grinning:

I forgot to install (SDK Platform) from Android SDK Manager.