How to install android targets (SDKs)?

Viewed 6365

I am new to cordova developments. Before I getting started with cordova i installed Android SDK from the command line. And JDK and Apache ant also already installed. According to the cordova documention i checked the cordova requirements as follows with cordova requirements command. And it shows android target is not installed. How do i fix this? without this, Is that would cause to furthuer develoment with cordova.

C:\Users\Nav\Documents\cordova_dev\cordova\hello>cordova requirements

    Requirements check results for android:
    Java JDK: installed 1.8.0
    Android SDK: installed true
    Android target: not installed
    No android targets (SDKs) installed!
    Gradle: installed C:\Program Files\Android\Android Studio\gradle\gradle-2.14.1\bin\gradle
    Error: Some of requirements check failed
2 Answers

I suggest to you to use a gradle updated. I'm using at january 2018 gradle 4.1

To set the target of your android project you can run:

$ export ORG_GRADLE_PROJECT_cdvMinSdkVersion=21
$ cordova build android

As is written in doc: https://cordova.apache.org/docs/en/dev/guide/platforms/android/index.html#setting-gradle-properties

And if at least yet doesn't working... download the appropriated build tool. With command line is:

$ android/tools/bin/sdkmanager "build-tools;21.0.0"

And try again the requirement or build.

Related