How to install android targets (SDKs)?

前端 未结 2 476
走了就别回头了
走了就别回头了 2021-02-08 12:36

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 t

相关标签:
2条回答
  • 2021-02-08 12:52

    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.

    0 讨论(0)
  • 2021-02-08 12:55

    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
    
    0 讨论(0)
提交回复
热议问题