Cordova Please Install Android target 19

前端 未结 7 1325
无人共我
无人共我 2020-12-21 00:48

I am using Cordova-3.3.0, and when trying to create a project for Android I am getting this following error -

Error: Please install Android target 19

相关标签:
7条回答
  • 2020-12-21 01:08

    If you are using Windows, just go to the environment variables in system and look the System's variable and add both:

    C:\proyectos\adt-bundle-windows-x86_64-20131030\sdk\tools\;

    C:\proyectos\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\

    ¡live long and prosper!

    0 讨论(0)
  • 2020-12-21 01:13

    Have you correctly set android SDK tools in your Path ?

    For Cordova command-line tools to work, you need to include the SDK's tools and platform-tools directories in your PATH environment. On Mac, you can use a text editor to create or modify the ~/.bash_profile file, adding a line such as the following, depending on where the SDK installs:

    You have to install the SDK and include tools and platform-tools directories to your path, after you need to install correct versions of Android (19 in your case).

    0 讨论(0)
  • 2020-12-21 01:15

    I faced the same problem and the way I solved it is by lunching SDK Manager through the command prompt

    The error looked like:

    Error: Please install Android target "android-19".
    Hunt: Run "android" from your command-line to open the SDK manager.
    

    I simply opened the SDK manager, scrolled down, and downloaded the "Android 4.4.2 (API 19)" as a package and the problem was solved.

    0 讨论(0)
  • 2020-12-21 01:19

    I had the same problem, and in my case I was setting the

    sdk.dir
    

    property to an invalid location.

    Search that property in the whole project and check its value. In my case it was in local.properties, but take a look to project.properties, and ant.properties because they all are loaded in Android's build.xml file.

    Hope it helps!

    0 讨论(0)
  • 2020-12-21 01:19

    I've just had the same issue, even though I had set the path environment variable for the OS. It turned out to be because I was using Powershell. It worked after I added the following to my profile.ps1:

    $env:Path += ";C:\Users\Dan\AppData\Local\Android\sdk\android-sdk\tools"
    $env:Path += ";C:\Users\Dan\AppData\Local\Android\sdk\android-sdk\platform-tools"
    

    Typically, the profile.ps1 path will be here:

    C:\Users\<username>\Documents\WindowsPowerShell\profile.ps1
    

    To be honest, I'm not quite sure why it didn't work when I added them via the Windows GUI (ie. Advanced System Settings -> Environment variables). So perhaps it's a configuration issue on my part - eitherway, adding it to my profile.ps1 fixed it - so I thought I'd add it hear incase it helps anyone else.

    0 讨论(0)
  • 2020-12-21 01:24
    • Launches " SDK Manger" with administrator rights
    • Install Android 4.4.2 (API 19)
    • and retry command-line : cordova platforms add android
    0 讨论(0)
提交回复
热议问题