cordova platform add android not working while listing Android targets

后端 未结 12 1744
野趣味
野趣味 2020-11-29 16:48

I got problem when i want to add an android platform to my phoneGap application. I got this message in my CLI when i execute the command cordova platform add android :

相关标签:
12条回答
  • 2020-11-29 17:31

    Accepted answer is good and to the point.

    I have come across another page where its very well explained with screen shots.

    You can refer http://bealers.com/2014/06/phonegap-android-development-environment-for-windows/

    0 讨论(0)
  • 2020-11-29 17:34

    The answer is "All of the Above". Do as mentioned with the environment variables, however, also do this:

    C:\Users{YOUR_NAME}.cordova\lib\android\cordova\3.5.0\framework edit the project.properties file and change target=android-19 to target=android-20.

    Presumably this will need to be changed for the next rendition of android sdk's as well until this little issue gets resolved.

    0 讨论(0)
  • 2020-11-29 17:37

    after a long struggle, after doing all of the above suggestions more then once with growing desperation, i simply openned my cmd as administrator. it worked. i guess i just got too used for "sudo" before i got this pc.

    0 讨论(0)
  • 2020-11-29 17:38

    For those who have encountered this problem I add something extra that can be helpful, in my case had all the variables properly configured and this was still unable to add android platform and I did was disable my avast antivirus and puff! everything flowed smoothly, what was happening was that the antivirus was blocking the creation of the platform.

    Also important for me was to restart the pc. ;)

    Regards.

    0 讨论(0)
  • 2020-11-29 17:41

    We have a list of solutions here, so I add my one. That was not clear for me until I just try. You should add %ANT_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools to USER PATH variable, not to a System one. System PATH variable will automatically concatenate the USER PATH variable and translate variables to its value. Hope that helps somebody. P.S. My OS is Win 7x64

    0 讨论(0)
  • 2020-11-29 17:42

    This problem is usually cause because of PATH variable has not been set for Android SDK.

    export HOME="/home/yourname"
    export ANDROID_HOME="$HOME/android-bundle/sdk/tools"
    export ANDROID_PLATFORM_TOOLS="$HOME/android-bundle/sdk/platform-tools"
    export PATH="$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS:$PATH"
    export ANT_HOME="$HOME/ant"
    export PATH="$PATH:$ANT_HOME/bin"
    
    0 讨论(0)
提交回复
热议问题