gpt4 book ai didi

android - ionic 无法运行 ionic 平台android

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:31:42 28 4
gpt4 key购买 nike

我开始关注this用于学习 ionic 框架的演示。

我已经到了提示我输入 ionic platform android 的地步。当我键入它时,出现此错误:

C02FF724DF91:todo jcorser$ ionic platform android
Creating android project...

/Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:126
throw e;
^
Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.
at /Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/lib/check_reqs.js:158:19
at _fulfilled (/Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:760:13)
at /Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:821:14
at flush (/Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:419:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:906:3
Error: /Users/jcorser/.cordova/lib/npm_cache/cordova-android/3.6.3/package/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:135: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)

我在 Mac OSX 上。在使用 Android Studio 之前,我已经开发了两个 android 应用程序。我还遵循了手册 $ export JAVA_HOME=$(/usr/libexec/java_home) 上针对 OSX 的建议,但这并没有解决问题。

最佳答案

如果你通过 Homebrew 安装了 Android SDK,那么修复是这样的:

export ANDROID_HOME=`brew --prefix android`

关于android - ionic 无法运行 ionic 平台android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25982325/

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