科尔多瓦平台添加android的 - 不工作的Mac OS [英] cordova platform add android - Not working on Mac Os

查看:174
本文介绍了科尔多瓦平台添加android的 - 不工作的Mac OS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来科尔多瓦的移动应用程序的开发。我有安装节点,然后再安装科尔多瓦。我做这些步骤来创建一个科尔多瓦Android应用程序。

I'm new to cordova mobile app development. I have install Node and then install cordova. i have done those steps to create a cordova android app.

  1. 在科尔多瓦创建您好com.example.hellow的HelloWorld 此做工精细
  2. CD打招呼的导航到目录_
  3. 在科尔多瓦平台添加android的这不是工作
  1. cordova create hello com.example.hellow HelloWorld This work fine
  2. cd hello Navigation to directory_
  3. cordova platform add android This is not working

这是显示错误我的终端

Jeys-MacBook-Pro:hello mactec$ cordova platform add android
Creating android project...

/Users/mactec/.cordova/lib/android/cordova/3.4.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/mactec/.cordova/lib/android/cordova/3.4.0/bin/lib/check_reqs.js:85:29
    at _rejected (/Users/mactec/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:808:24)
    at /Users/mactec/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:834:30
    at Promise.when (/Users/mactec/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:1079:31)
    at Promise.promise.promiseDispatch (/Users/mactec/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:752:41)
    at /Users/mactec/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:574:44
    at flush (/Users/mactec/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:415:13)
Error: /Users/mactec/.cordova/lib/android/cordova/3.4.0/bin/create: Command failed with exit code 8
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/src/superspawn.js:126:23)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Process.ChildProcess._handle.onexit (child_process.js:810:5)
Jeys-MacBook-Pro:hello mactec$ 

请帮我短了这个问题

在此先感谢。

推荐答案

现在的问题是道路上的.bash_profile错误地定义。

The problem is PATH wrongly defined on .bash_profile.

  1. 更改对bash的配置文件的路径开〜/ .bash_profile中。然后bash的配置文件在文本编辑器中打开。
  2. 添加正确的路径到Android SDK。如果我们有机器人工作室则路径为/应用/ Android的Studio.app / SDK /所以我们需要添加这条道路对.bash_profile。 导出路径= $ {PATH}:/应用/安卓\ Studio.app / SDK /工具
  3. 然后关闭所有的终端,然后再次打开和code ...:)
  1. Change the path on bash profile open ~/.bash_profile. Then the bash profile open in a text editor.
  2. Add the correct path to android SDK. If we have android studio then the path is /Application/Android Studio.app/sdk/ so we need to add this path to .bash_profile. export PATH=${PATH}:/Applications/Android\ Studio.app/sdk/tools
  3. Then close all terminal and open again and code... :)

您可检查工作或没有通过键入机器人端子。

这篇关于科尔多瓦平台添加android的 - 不工作的Mac OS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆