cordova platform add android - Not working on Mac Os

前端 未结 3 740
情歌与酒
情歌与酒 2020-12-20 01:49

I\'m new to cordova mobile app development. I have install Node and then install cordova. i have done those steps to create a cordova android app.

  1. cordova crea
相关标签:
3条回答
  • 2020-12-20 02:03

    There's also another potential cause for this error: an errant file in your project/www directory. I had inadvertently included a blank file called project/www/:q ("colon q") in www/ (note I use Vim)! Anyway, doing this yields the exact error as noted by JeyTheva. So, delete that file and do the following:

    • cordova platform remove android
    • rm -r ~/.cordova/lib/android
    • cordova platform add android

    Now rebuild and run on your device. This should work if you did something similar to what I did.

    0 讨论(0)
  • 2020-12-20 02:23

    The problem is PATH wrongly defined on .bash_profile.

    What i have done for this.

    1. Change the path on bash profile open ~/.bash_profile. Then the bash profile open in a text editor.
    2. Add the correct path to android SDK. If we have android studio then the path is /Application/Android Studio.app/sdk/ so we need to add this path to .bash_profile. export PATH=${PATH}:/Applications/Android\ Studio.app/sdk/tools
    3. Then close all terminal and open again and code... :)

    You can check that is working or not via typing android on terminal.

    0 讨论(0)
  • 2020-12-20 02:30

    The error show in quite clear.You have to have the android sdk installed and proper path set in the system variable for the SDK, for cordova to work.See the prerequisites in cordova documentation http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html.For cordova 3.4 project android SDK must have target 19 installed.

    Download SDK here http://developer.android.com/sdk/index.html

    Here is the platform guide for more information http://cordova.apache.org/docs/en/3.0.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide

    If you already have the SDK installed,check to see if the path is refered properly for cordova to find

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