0

我知道你在想什么。不,这不是您会看到的任何常见错误。我正在使用 Macbook,仅供参考。我第一次使用cordova/phonegap/ionic/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)

我真的不知道该怎么办。任何人都可以提供任何见解吗?我找到了这些解决方案,但我无法弄清楚如何使用它们......

将 Android 添加到 Phonegap 项目时出现错误

Phonegap 3 不适用于 Android Studio

编辑<<<< 这个解决方案可能有效!我将尝试并让您知道 > http://docs.phonegap.com/en/2.8.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android

4

1 回答 1

0

我只需要将正确的路径添加到我的 .bash_profile 文件中。一开始我很困惑,但现在我明白了。

于 2014-01-21T19:08:37.487 回答