0

我正在 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 emulate 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

FAILURE:构建失败并出现异常。

  • 其中:构建文件 '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:\Users\Giovanni\android\DerpyWorld\platforms\android\cordova\node_modules\q\q.js:126 抛出 e;^ 命令的错误代码 1:带有 args 的 cmd:/s,/c,C:\Users\Giovanni\android\DerpyWorld\platforms\android\gradlew,assembleX86Debug,-b,C:\Users\Giovanni\android\DerpyWorld\平台\android\build.gradle,-Dorg.gradle.daemon=true,-x,lint,-x,lintVitalX86Release,-x,lintVitalArmv7 Release,-x,compileLint,-x,copyReleaseLint,-x,copyDebugLint 错误:C :\Users\Giovanni\android\DerpyWorld\platforms\android\cordova\run.bat: 命令在 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) 在可能关闭 (child_process.js:756:16) 在 Process。

C:\Users\Giovanni\android\DerpyWorld>C:\Users\Giovanni\android\DerpyWorld\gradle\wrapper\gradle-wrapper.properties 到 gradle-1.10-all.zip

4

1 回答 1

0

问题在于这一行:

cmd "/s /c ""C:\Users\Giovanni\Google Drive\cde\dwm\DerpyWorld\platforms\android\cordova\run.bat" --emulator""

路径未作为参数正确传递,并且解析未读取路径中的值。

CCA 中某处有一个设置决定了这条线的值,它是不正确的。您需要仔细检查该字符串中的“”,因为它们会导致您的错误。

于 2014-12-17T20:10:40.290 回答