当前位置 : 主页 > 手机开发 > cordova >

为什么PhoneGap / Cordova没有添加Android平台?

来源:互联网 收集:自由互联 发布时间:2021-06-10
所以我已经尝试了几天将 android平台添加到我的项目中,但我一直在终端中得到这个响应. (使用OSX,Phonegap 3.3.0) Creating android project.../usr/local/lib/node_modules/cordova/node_modules/q/q.js:126 throw e; ^
所以我已经尝试了几天将 android平台添加到我的项目中,但我一直在终端中得到这个响应. (使用OSX,Phonegap 3.3.0)

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/XerxesNoble/.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/XerxesNoble/.cordova/lib/android/cordova/3.3.0/bin/lib/check_reqs.js:85:29
    at _rejected (/Users/XerxesNoble/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:808:24)
    at /Users/XerxesNoble/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:834:30
    at Promise.when (/Users/XerxesNoble/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:1079:31)
    at Promise.promise.promiseDispatch (/Users/XerxesNoble/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:752:41)
    at /Users/XerxesNoble/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:574:44
    at flush (/Users/XerxesNoble/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:415:13)

    at /usr/local/lib/node_modules/cordova/src/platform.js:244:30
    at ChildProcess.exithandler (child_process.js:641:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:735:16)
    at Socket.<anonymous> (child_process.js:948:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)

我确保从developer.android安装SDK,并将我的.bash-profile $PATH设置为:

export PATH=${PATH}:Android/sdk/platform-tools:Android/sdk/tools

在这一点上,我真的不确定我还能做些什么来解决这个问题.

任何帮助将非常感激!

此错误是因为Android未定义到您的计算机,这意味着您的路径不正确,因此您所要做的就是使用相应的路径更新bash配置文件.
我认为PATH = ${PATH}:Android / sdk / platform-tools:Android / sdk / tools不对,它应该是这些文件夹的绝对路径.
就像是:

export PATH=/Users/your_user/adt-bundle-mac-x86_64-20130522/sdk/tools/:/Users/your_user/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/:$PATH
网友评论