2014-01-21 205 views
0

加入平台的时候,我知道你在想什么。不,这不是你会看到的任何常见错误。我正在研究Macbook,仅供参考。我与科尔多瓦/ PhoneGap的/离子/ angularjs/MongoDB的/工作的NodeJS是第一次和我开始一个新项目,我得到这个错误:错误科尔多瓦命令行

MacbookThrone:hello neema$ sudo cordova platform add android 
Creating android project... 

/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126 
       throw e; 
        ^
Error: An error occured during creation of android sub-project. 

/Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:126 
       throw e; 
        ^
Error: The command "android" failed. Make sure you have the latest Android SDK installed, and the "android" command (inside the tools/ folder) is added to your path. 
at /Users/neema/.cordova/lib/android/cordova/3.3.0/bin/lib/check_reqs.js:85:29 
at _rejected (/Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:808:24) 

,它只是继续和这样。我读了一个解决方案可能是运行这个命令:

MacbookThrone:hello neema$ phonegap build android 

但只是把这个错误:

MacbookThrone:hello neema$ phonegap build android 
[phonegap] detecting Android SDK environment... 
[phonegap] using the local environment 
[phonegap] adding the Android platform... 
    [error] An error occured during creation of android sub-project. 

/Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:126 
       throw e; 
        ^
Error: The command "android" failed. Make sure you have the latest Android SDK installed, and the "android" command (inside the tools/ folder) is added to your path. 
at /Users/neema/.cordova/lib/android/cordova/3.3.0/bin/lib/check_reqs.js:85:29 
at _rejected (/Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:808:24) 
at /Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:834:30 
at Promise.when (/Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:1079:31) 
at Promise.promise.promiseDispatch (/Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:752:41) 
at /Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:574:44 
at flush (/Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:108:17) 
at process._tickCallback (node.js:415:13) 

我真的不知道该怎么做。谁能提供任何见解?我发现这些解决方案,但我想不出如何让他们去...

Getting error when adding Android to Phonegap project

Phonegap 3 doesn't work with Android Studio

编辑< < < < 这种解决方案可能会奏效!我要去尝试,让你知道>http://docs.phonegap.com/en/2.8.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android

回答

0

我只是需要正确的路径添加到我的.bash_profile文件中。起初它很混乱,但现在我明白了。