Phonegap命令失败,退出代码为8 - Ubuntu

时间:2014-09-02 18:42:45

标签: android bash cordova ant

我试图用[phonegap] [1](cordova)在javascript中创建我的第一个Android应用程序。 但当我把#34; phonegap运行android" 退出时出现错误8 ,这是代码,这里是图片:http://i.stack.imgur.com/qofsZ.png(由于声誉而无法发布屏幕):

< / p> <小时/> giulio @ cucina:〜/ Documenti / web / sveglia / sveglia $ phonegap run android
[phonegap]检测Android SDK环境...
[phonegap]使用当地环境
[phonegap]添加Android平台...

/home/giulio/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:126
                    扔e;
                          ^ 错误:列出Android目标时发生错误
    at /home/giulio/.cordova/lib/android/cordova/3.5.1/bin/lib/check_reqs.js:87:29
    在_rejected(/home/giulio/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:808:24)
    在/home/giulio/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:834:30
    在Promise.when(/home/giulio/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:1079:31)
    在Promise.promise.promiseDispatch(/home/giulio/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:752:41)
    在/home/giulio/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:574:44
    在同花顺(/home/giulio/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:108:17)
    at process._tickCallback(node.js:419:13)
{[错误:/home/giulio/.cordova/lib/android/cordova/3.5.1/bin/create:命令失败,退出代码为8]代码:8}
   [错误] /home/giulio/.cordova/lib/android/cordova/3.5.1/bin/create:命令失败,退出代码为8


我已尝试按照以下说明操作:stackoverflow.com/questions/20323787/cordova-platform-add-android-not-working-while-listing-android-targets/21142421#21142421和stackoverflow.com/问题/ 24380283 / phonegap-run-android-create-command-failed-with-exit-code-8-linux,但它再次起作用。 这是bashrc(http://i.stack.imgur.com/mdLDY.png),我将代码置于顶部:


导出ANDROID_HOME =&#34; / media / giulio / Secondo \ Disco / Development / android-sdk-linux / tools&#34;
export ANDROID_PLATFORM_TOOLS =&#34; / media / giulio / Secondo \ Disco / Development / android-sdk-linux / platform-tools&#34;
export PATH =&#34; $ ANDROID_HOME:$ ANDROID_PLATFORM_TOOLS:$ PATH&#34;
export PATH =&#34; $ PATH:/ usr / share / ant / bin&#34;
〜/ .bashrc:由bash(1)执行非登录shell ...等


我已经安装了android软件包,ant和所有必需的东西。 你是我最后的机会! d:

1 个答案:

答案 0 :(得分:0)

导出两个变量:

ANDROID_HOME和JAVA_HOME

此外,将android平台工具放在PATH上,对我有用。

就我而言,它是这样的:

export ANDROID_HOME=/home/YOURUSER/sw/android/adt-bundle-linux-x86-20131030/sdk/
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386/
export PATH="/home/YOURUSER/sw/android/adt-bundle-linux-x86-20131030/sdk/platform-tools/:/home/YOURUSER/sw/android/adt-bundle-linux-x86-20131030/sdk/tools:tools:$PATH"