我正在使用Chrome API制作Android应用。我设置了我的模拟器,除了CCA抛出一个奇怪的错误之外,一切似乎都运行正常。
C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld>cca emulate android
cca v0.5.0
Running command: "C:\Program Files\nodejs\node.exe" "C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld\hooks\before_prep are\cca-check.js" "C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld"
Running command: cmd "/s /c ""C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld\platforms\android\cordova\run.bat" --emulator""
'C:\Users\Giovanni\Google' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s,/c,C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld\platforms\android\gradl
ew,assembleX86Debug,-b,C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld\platforms\android\build.gradle,-Dorg.gradle.dae
mon=true,-x,lint,-x,lintVitalX86Release,-x,lintVitalArmv7Release,-x,compileLint,-x,copyReleaseLint,-x,copyDebugLint
Error: cmd: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\Giovanni\AppData\Roaming\npm\node_modules\cca\node_modules\cordova\node_modules\c
ordova-lib\src\cordova\superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld>
有什么想法吗?
哦,我通过将它移动到没有空格的文件夹来解决最后一个问题......一个非常糟糕的修复imo。当然,问题还在继续。
C:\ Users \ Giovanni \ android \ DerpyWorld> cca模拟android cca v0.5.0 运行命令:“C:\ Program Files \ nodejs \ node.exe”C:\ Users \ Giovanni \ android \ DerpyWorld \ hooks \ before_prepare \ cca-check.js C:\ Users \ Giovanni \ android \ DerpyWorld 运行命令:C:\ Users \ Giovanni \ android \ DerpyWorld \ platforms \ android \ cordova \ run.bat --emulator
失败:构建因异常而失败。
其中: 构建文件'C:\ Users \ Giovanni \ android \ DerpyWorld \ platforms \ android \ build.gradle'行:27
出了什么问题: 评估根项目'android'时出现问题。
无法应用插件[id'android'] Gradle版本1.10是必需的。当前版本是2.2.1。如果使用gradle包装器,请尝试将C:\ Users \ Giovanni \ android \ DerpyWorld \ gradle \ wrapper \ gradle-wrapper.properties中的distributionUrl编辑为gradle-1.10-all.zip
尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。
建立失败
总时间:1.178秒
C:\用户\乔瓦尼\机器人\ DerpyWorld \平台\机器人\科尔多瓦\ node_modules \ q \ q.js:126 扔掉; ^ 命令的错误代码1:cmd with args:/ s,/ c,C:\ Users \ Giovanni \ android \ DerpyWorld \ platforms \ android \ gradlew,assembleX86Debug,-b,C:\ Users \ Giovanni \ android \ DerpyWorld \ platforms \机器人\的build.gradle,-Dorg.gradle.daemon =真,-x,棉绒-x,lintVitalX86Release,-x,lintVitalArmv7 发布,-x,compileLint,-x,copyReleaseLint,-x,copyDebugLint 错误:C:\ Users \ Giovanni \ android \ DerpyWorld \ platforms \ android \ cordova \ run.bat:命令失败,退出代码为8 在ChildProcess.whenDone(C:\ Users \ Giovanni \ AppData \ Roaming \ npm \ node_modules \ cca \ node_modules \ cordova \ node_modules \ cordova-lib \ src \ cordova \ superspawn.js:135:23) 在ChildProcess.emit(events.js:98:17) 在maybeClose(child_process.js:756:16) 在Process.ChildProcess._handle.onexit(child_process.js:823:5)
C:\ Users \ Giovanni \ android \ DerpyWorld> C:\ Users \ Giovanni \ android \ DerpyWorld \ gradle \ wrapper \ gradle-wrapper.properties to gradle-1.10-all.zip
答案 0 :(得分:0)
问题在于这一行:
cmd "/s /c ""C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld\platforms\android\cordova\run.bat" --emulator""
路径未作为参数正确传递,并且解析不会读取路径中的。
CCA中有一个设置确定此行的值,但它不正确。您需要仔细检查该字符串中的"",因为它们会导致您的错误。