Cordova 4.3.0 Error: Please install Android target: “android-21”

前端 未结 5 1432
时光取名叫无心
时光取名叫无心 2021-02-05 21:51

I have a project that is running well with ripple emulator, but when i try to launch it on a physical Android device, I get the following error :

Error:

相关标签:
5条回答
  • 2021-02-05 21:54

    You should also edit the file platforms/android/project.properties and input the correct target.

    0 讨论(0)
  • 2021-02-05 22:07

    I had the same problem. I found it was the name of the project which posed the problem because it contained special characters like '&'.

    So I renamed my project with a simple name and it works very well now.

    0 讨论(0)
  • 2021-02-05 22:11

    You should install the following packages

    1. Android SDK Platforms-tools (Latest)
    2. Android SDK build-tools (Latest)
    3. SDK Platform (api 22)

    For your reference please see the screenshot attached below

    0 讨论(0)
  • 2021-02-05 22:13

    I'm simply compiling two existing answers, which are both required to solve the problem.

    Go to

    project folder -> platforms -> android -> AndroidManifest.xml
    

    find something like

    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="21" />
    

    and change the 21 to 19.

    Then go to

    project folder -> platforms -> android -> project.properties
    

    and change

    target=android-21
    

    to

    target=android-19
    
    0 讨论(0)
  • 2021-02-05 22:16

    Go to

     project folder -> platforms -> android -> AndroidManifest.xml
    

    find something like

    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
    

    you will see it's targetSdkVersion is 21. make that 19 and run for now. To go with 21, update your android tools.

    0 讨论(0)
提交回复
热议问题