无法在科尔多瓦3.3加Android平台科尔、多瓦、平台、Android

2023-09-05 08:38:43 作者:奶糖迦娜

我试图通过添加android平台:

I tried to add the android platform by:

$ cordova platform add android

我得到了这一点:

I get that out:

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

我指定的SDK的路径在.bash_profile中,有更多的东西,我需要做什么?

I specified the SDK's path in the .bash_profile, is there something more I need to do?

感谢您的解答!

推荐答案

我固定它!首先,你必须到Android工具和平台工具添加到您的PATH ...

I fixed it!! First you have to add android tools and platform tools to your PATH...

所以,打开用户配置文件(在终端中输入:)

So open your user profile ( in terminal type:)

nano ~/.profile
PATH=$PATH:/YOUR_ADT_FOLDER/sdk/platform-tools:/YOUR_ADT_FOLDER/sdk/tools
export PATH

保存并输入端子:

. ~/.profile

现在尝试添加您科尔多瓦的平台,如果它不工作尝试安装Apache Ant。我使用的是基本的操作系统,所以我打开软件中心,搜索蚁E安装它。后看蚁族是你的终端上,然后添加你的平台。

Now try to add your cordova platform, if it not works try to install apache ant. I'm using elementary os, so I opened the software center, searched for ant e install it. After it see if 'ant' is on your terminal and then add your platform.