Phonegap运行android无法正常工作

时间:2014-03-29 20:52:06

标签: android ubuntu cordova ant path

我试图运行带有phonegap的Android应用程序,我使用Ubuntu 13.10并且我遇到以下问题:

 quest@quest:~/my-app$ phonegap run android
    [phonegap] detecting Android SDK environment...
    [phonegap] using the local environment
    [phonegap] adding the Android platform...

    /home/quest/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:126
                    throw e;
                          ^
Error: An error occurred while listing Android targets
    at /home/quest/.cordova/lib/android/cordova/3.4.0/bin/lib/check_reqs.js:87:29
    at _rejected (/home/quest/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:808:24)
    at /home/quest/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:834:30
    at Promise.when (/home/quest/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:1079:31)
    at Promise.promise.promiseDispatch (/home/quest/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:752:41)
    at /home/quest/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:574:44
    at flush (/home/quest/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:415:13)
   [error] /home/quest/.cordova/lib/android/cordova/3.4.0/bin/create: Command failed with exit code 8

e/quest/.cordova/lib/android/cordova/3.4.0/bin/create: Command failed with exit code 8
    quest@quest:~/my-app$ brew install ant

    Warning: ant-1.9.3 already installed

这是PATH

        quest@quest:~/my-app$ echo $PATH
    /home/quest/.linuxbrew/bin:/home/quest/.linuxbrew/bin:/home/quest/.linuxbrew/bin:/home/quest
/adt-bundle/sdk/tools:/home/quest/adt-bundle/sdk/platform-tools:/home/quest/android-sdk-
linux/platform-tools:/home/quest/android-sdk-
linux/tools:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
:/bin:/usr/games:/usr/local/games:adt-bundle-linux-x86_64-20131030/sdk/tools:adt-
bundle/sdk/tools:/Downloads/adt-bundle/sdk/platform-tools:/Downloads/adt-
bundle/sdk/tools:/Downloads/adt-bundle/sdk/platform-tools:/Development/adt-
bundle/sdk/tools:/usr/local/jdk/bin:/usr/local/ant/bin:/home/quest/ant/bin

1 个答案:

答案 0 :(得分:2)

请使用以下命令检查系统路径

echo $PATH

并确保添加了蚂蚁路径。如果没有,则添加到路径。