How to install android targets (SDKs)?

萝らか妹 提交于 2020-07-04 13:10:28

问题


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

回答1:


Try installing a target with sdkmanager on the command line.
e.g.

sdkmanager "platforms;android-26"

and then trying cordova requirements again.
Hopefully you should then get the message:

Android target: installed android-26



回答2:


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.



来源:https://stackoverflow.com/questions/45431926/how-to-install-android-targets-sdks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!