2014-01-21 238 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文件中。起初它很混亂,但現在我明白了。