gpt4 book ai didi

android - 将 Android 添加到 Phonegap 项目时出错

转载 作者:行者123 更新时间:2023-11-30 03:10:27 26 4
gpt4 key购买 nike

我是 phonegap 的新手。当我在 phonegap 中添加 android 时出现错误。我用过this steps解决这个错误,但我仍然收到这个错误:

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

最佳答案

您必须将 /pathToAndroidFolder/sdk/platform-tools/pathToAndroidFolder/sdk/tools 添加到您的 $PATH

Mac OSX 的步骤:使用 nano 或任何其他编辑器编辑您的 .bash_profile

nano ~/.bash_profile

添加这一行

export PATH=${PATH}:/Users/ss/Documents/Software/adt-bundle-mac-x86_64-20130729/sdk/tools:/Users/ss/Documents/Software/adt-bundle-mac-x86_64-20130729/sdk/platform-tools

打开一个新的终端窗口使其工作,或者使用此命令使其在当前终端窗口上工作:

source ~/.bash_profile

关于android - 将 Android 添加到 Phonegap 项目时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21085898/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com