Cordova Please Install Android target 19

前端 未结 7 1365
无人共我
无人共我 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: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\\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.

提交回复
热议问题