我设置了我的ENV变量和PhoneGap Android Build仍然失败

时间:2015-08-01 21:58:21

标签: android cordova ant build

嗨,我有建立Android应用程序的问题, 我下载了phonegap和cordowa(npm install),然后设置了env vars:

export PATH=$PATH:/home/marek/Android/Sdk/tools
export PATH=$PATH:/home/marek/Android/Sdk/platform-tools
export PATH=$PATH:/home/marek/Android/Sdk/build-tools

JAVA_HOME=/usr/lib/jvm/java-8-oracle
ANT_HOME=/usr/bin/ant
ANDROID_HOME=/home/marek/Android/Sdk

仍然收到此错误:

/home/marek/PhoneGapProjects/test-app/platforms/android/cordova/node_modules/q/q.js:126

                throw e;
                      ^
Error code 1 for command: /home/marek/PhoneGapProjects/test-app/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/marek/PhoneGapProjects/test-app/platforms/android/build.gradle,-Dorg.gradle.daemon=true

ERROR building one of the platforms: Error: /home/marek/PhoneGapProjects/test-app/platforms/android/cordova/build: Command failed with exit code 8
You may not have the required environment or OS to build this project

Error: /home/marek/PhoneGapProjects/test-app/platforms/android/cordova/build: Command failed with exit code 8
at ChildProcess.whenDone (/usr/lib/node_modules/phonegap/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)

如果有人可以帮助我真的很棒。

1 个答案:

答案 0 :(得分:0)

你是如何运行构建的?

尝试sudo -E env "PATH=$PATH" phonegap build android