gpt4 book ai didi

android - '错误 : the command "android" failed' using cordova

转载 作者:搜寻专家 更新时间:2023-11-01 08:49:51 25 4
gpt4 key购买 nike

我正在尝试在 cordova 上添加 android 平台。我已经在Android SDK中添加并下载了最新的SDK,我的路径是:export PATH=${PATH}:/Users/xxx/Development/android-sdk-macosx/platform-tools:Users/xxx/Development/android-sdk-macosx/tools,但我不断收到以下错误:

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/xxx/.cordova/lib/android/cordova/3.5.0/bin/lib/check_reqs.js:85:29
at _rejected (/Users/xxx/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:808:24)
at /Users/xxx/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:834:30
at Promise.when (/Users/xxx/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:1079:31)
at Promise.promise.promiseDispatch (/Users/xxx/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:752:41)
at /Users/xxx/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:574:44
at flush (/Users/xxx/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:419:13)
Error: /Users/xxx/.cordova/lib/android/cordova/3.5.0/bin/create: Command failed with exit code 8
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Process.ChildProcess._handle.onexit (child_process.js:822:5)

我做错了什么?我到处寻找答案,但似乎没有任何效果。提前致谢!

最佳答案

如果是 Apache Cordova Android Studio 0.8 适用于 Mac OS X 10.9,如果您已安装在默认的/Applications 文件夹中,请在终端上运行它

export ANDROID_HOME="/Applications/Android Studio.app/sdk"
export ANDROID_TOOLS="/Applications/Android Studio.app/sdk/tools/"
export ANDROID_PLATFORM_TOOLS="/Applications/Android Studio.app/sdk/platform-tools/"
PATH=$PATH:$ANDROID_HOME:$ANDROID_TOOLS:$ANDROID_PLATFORM_TOOLS

要确认,运行 echo 并获取

echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Applications/Android Studio.app/sdk:/Applications/Android Studio.app/sdk/tools/:/Applications/Android Studio.app/sdk/platform-tools/

对于 Cordova 3.6,它在新的 Android Studio 上引发了另一个错误

Error: Please install Android target "android-19"

要解决此问题,请在 IDE 中打开 SDK 管理器,然后下载提到的 android 版本 (android-19)

关于android - '错误 : the command "android" failed' using cordova,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24580966/

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