PhoneGap:在phonegap运行android时出错

时间:2014-02-09 18:27:51

标签: javascript node.js cordova web

我正在尝试

phonegap run android --device={device id here}

但每当我尝试运行phonegap应用程序时,都会发生以下情况:

[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
   [error] An error occured during creation of android sub-project. 

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

我的路径已完全设置

  • ADB
  • FASTBOOT
  • 的java

都在运作

我跑echo $PATH并获得以下

/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/lightshire/adt/adt-bundle-linux-x86_64-20131030/sdk/platform-tools:/home/lightshire/ant/bin

我还更新了android API,我发现问题将是我的设备,因为它的2.3所以我下载了所有的android API,包括2.3到4.4但我仍然有同样的错误。我实际上难以解决问题所在。

1 个答案:

答案 0 :(得分:0)

您是否正确设置了所有路径?

E:\ant\bin;                            -ant path
C:\Program Files\Java\jdk1.7.0_13\bin; -java path
E:\Node;                               -Node path
E:\Eclipse\sdk\platform-tools;         -SDK platform tool path
E:\Eclipse\sdk\tools;                  -SDK tool path
C:\Users\Account\Account\Roaming\npm;  -npm path