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

后端 未结 9 633
梦毁少年i
梦毁少年i 2020-12-04 11:50

I just updated cordova + ionic in my app, after that i installed successfully Android-SDK v22 via Android SDK manager.

But after the running command:



        
相关标签:
9条回答
  • 2020-12-04 12:38

    Follow these steps.
    1) Type android on command line.(Make sure ANDROID_HOME and PATH are set properly)
    2) Select API 21 from the populated list.
    3) Click install packages.
    4) Type android avd on command line.
    5) Set API level and other config.
    6) Now type ionic build android.

    0 讨论(0)
  • 2020-12-04 12:38

    In my case it was the path to my SDK folder that was causing this error.

    C:\Users\username\AppData\Local\Android\android-sdk

    changed to

    C:\Users\username\AppData\Local\Android\sdk

    0 讨论(0)
  • 2020-12-04 12:38

    Make sure your project path doesn't consist spaces.

    I face the same problem asking me to install the target android platform when build. I have triple confirm my android sdk path, jdk path and various setting in path but still getting the same error. Finally, the problem resolved by simply renamed(removed spaces) the folder that store my Cordova project. For example : "C:\Cordova & Phonegap Sample\MyCordovaApp" to "C:\Cordova_Sample\MyCordova".

    0 讨论(0)
  • 2020-12-04 12:39

    Open Android SDK Manager, and check whether the target version exists, Install if not exists.

    0 讨论(0)
  • 2020-12-04 12:42

    I have been having the same problem in windows. It appeared that when I was running the SDK Manager you have to select "Run as Administrator" otherwise it denies permission to install certain files, on of them being "ANDROID-22"

    Here is the the link I found to resolve this issue: android sdk manger not updating

    0 讨论(0)
  • 2020-12-04 12:45

    many times the problem is that not is configurated the path environment variable ANDRIOD_HOME. Take a look

    %ANDROID_HOME% = C:\Program Files (x86)\Android\android-sdk
    In Path:
    %ANDROID_HOME%\tools;
    %ANDROID_HOME%\platform-tools;
    
    0 讨论(0)
提交回复
热议问题