我正在尝试安装phonegap。我已经安装了node.js,java jdk,phonegap,apache-ant,我将所有路径变量添加到PATH:jdk,ant-apache,android-sdk,platform-tools,tools 它仍然无法运作:
[phonegap] executing 'cordova platform add android'...
[phonegap] completed 'cordova platform add android'
[phonegap] executing 'cordova run android'...
cp: no such file or directory: C:\Windows\System32\test\icon.png
Running command: C:\Windows\System32\test\platforms\android\cordova\run.bat
Buildfile: C:\Windows\System32\test\platforms\android\build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 23.0.5
[checkenv] Installed at C:\Users\Jenya\Downloads\r\sdk
-setup:
[echo] Project Name: CordovaApp
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 20.0.0
[echo] Resolving Build Target for CordovaApp...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\ant-build
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\ant-build\re
s
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\ant-build\rs
Obj
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\ant-build\rs
Libs
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\ant-gen
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\ant-build\cl
asses
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\ant-build\de
xedLibs
[echo] ----------
[echo] Resolving Dependencies for CordovaApp...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
nodeps:
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 23.0.5
[checkenv] Installed at C:\Users\Jenya\Downloads\r\sdk
-setup:
[echo] Project Name: CordovaApp
[gettype] Project Type: Android Library
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 20.0.0
[echo] Resolving Build Target for CordovaApp...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\CordovaLib\r
es
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\CordovaLib\l
ibs
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\CordovaLib\a
nt-build
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\CordovaLib\a
nt-build\res
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\CordovaLib\a
nt-build\rsObj
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\CordovaLib\a
nt-build\rsLibs
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\CordovaLib\a
nt-gen
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\CordovaLib\a
nt-build\classes
[mkdir] Created dir: C:\Windows\System32\test\platforms\android\CordovaLib\a
nt-build\dexedLibs
[echo] ----------
[echo] Resolving Dependencies for CordovaApp...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[aapt] ERROR: resource directory 'C:\Windows\System32\test\platforms\androi
d\CordovaLib\res' does not exist
BUILD FAILED
C:\Users\Jenya\Downloads\r\sdk\tools\ant\build.xml:601: The following error occu
rred while executing this line:
C:\Users\Jenya\Downloads\r\sdk\tools\ant\build.xml:653: The following error occu
rred while executing this line:
C:\Users\Jenya\Downloads\r\sdk\tools\ant\build.xml:698: null returned: 1
Total time: 1 second
C:\Windows\System32\test\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,C:\Windows\System32\
test\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: C:\Windows\System32\test\platforms\android\cordova\run.bat: Command faile
d with exit code 8
at ChildProcess.whenDone (C:\Users\Jenya\AppData\Roaming\npm\node_modules\ph
onegap\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:1
35: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)
我该怎么做才能让它发挥作用?
好的。问题解决了。在我看来,它与C驱动器上的一些权限问题有关,我在D上创建了新项目并且它有效。