Ionic on Windows: Android SDK installed. Still get “Error: Please install Android target: ”android-22"

前端 未结 7 1103
鱼传尺愫
鱼传尺愫 2021-01-01 21:46

I have managed to break my previously working version of the Ionic enviroment. For example: I download the demo project \"sidemenu\" and run \"ionic platform add android\" w

相关标签:
7条回答
  • 2021-01-01 22:24

    First of all, sorry for my dummy english. I just had the same problem and I fix it changing the target:

    # Project target.    
    target=android-22 (I had set this to android-23)
    

    This should be done in two files:

    yourApp/platforms/android/project.properties    
    yourApp/platforms/android/CordovaLib/project.properties
    

    Also the manifest should be updated:

    <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" />
    
    0 讨论(0)
  • 2021-01-01 22:29

    I've had the same issue. Problem was I was using cmder. Switching to windows cmd solved it for me.

    0 讨论(0)
  • 2021-01-01 22:31

    Try to make the following steps one by one and will be working:

    installation guide

    See windows note and install all packages.You must have java jdk installed.And after set environement variable for ANDROID_HOME with command:set ANDROID_HOME="your android location".Hope this helps!

    0 讨论(0)
  • 2021-01-01 22:32

    Another possible reason might be that you have multiple Android SDK installations on your machine, and that Ionic is looking at the wrong installation, Ionic looks for the ANDROID_HOME environment variable, so make sure that it is set and pointing to the same location as the SDK manager you launch from Android Studio.

    Modify or add that Environment Variable under the system path variables to make sure it applies to all users(you will have to relaunch command Prompt for changes to apply). Windows has two sets of environment variables, system and user, so if you run the command prompt as an Administrator for example you might get different environment variables.

    You can read more here: https://superuser.com/questions/625643/why-is-my-path-environment-variable-different-from-the-command-prompt

    0 讨论(0)
  • 2021-01-01 22:34

    I was having the same issue and this worked for me. I have Android Studio installed, which makes managing the SDK a lot easier.

    1) When you launch Android Studio, click on the "Configure" option

    2)Then click SDK Manager

    4) Then select Android 5.1.1 which is the API level 22 that you need. Refer to the screenshot below.

    5) Hit Apply

    This will installed the required android-22 that your build is asking for.

    0 讨论(0)
  • 2021-01-01 22:34

    I also tried many settings to Use SDK 22

    Config.xml

    \platforms\android\project.properties

    target=android-23

    \platforms\android\AndroidManifest.xml

    platforms\android\CordovaLib\project.properties

    target=android-23

    Nothing worked till I not accepted SDK 22 licenses via command line

    Remember to accept or install license newly installed SDK otherwise build process will show you an error or will try to install SDK which licenses you installed into your system.

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