Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/185.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Phone Gap[错误]cmd:命令失败,退出代码为8_Android_Windows_Node.js_Cordova - Fatal编程技术网

Android Phone Gap[错误]cmd:命令失败,退出代码为8

Android Phone Gap[错误]cmd:命令失败,退出代码为8,android,windows,node.js,cordova,Android,Windows,Node.js,Cordova,我是“phonegap”的新手,我刚刚在我的Win7 x64电脑上安装了所有必要的工具,以便让它在我的第一个android应用程序上运行(在安装之后) -->非常感谢您的帮助,提前谢谢 在执行命令之后 npm安装-g phonegap phonegap创建myapp phonegap构建本地android 我在cdm中不断收到以下错误消息: E:\Android development\nodejs\mmiapp>phonegap local build android

我是“phonegap”的新手,我刚刚在我的Win7 x64电脑上安装了所有必要的工具,以便让它在我的第一个android应用程序上运行(在安装之后)

-->非常感谢您的帮助,提前谢谢

在执行命令之后

  • npm安装-g phonegap

  • phonegap创建myapp

  • phonegap构建本地android

  • 我在cdm中不断收到以下错误消息:

        E:\Android development\nodejs\mmiapp>phonegap local build android
        [phonegap] adding the Android platform...
    
        C:\Users\Reen\.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\q.js:126
                    throw e;
                          ^
        Error: ERROR : executing command 'ant', make sure you have ant installed and add ed to your path.
            at C:\Users\Reen\.cordova\lib\android\cordova\3.5.0\bin\lib\check_reqs.js:47:27
    
        at ChildProcess.exithandler (child_process.js:651:7)
        at ChildProcess.emit (events.js:98:17)
        at maybeClose (child_process.js:755:16)
        at Socket.<anonymous> (child_process.js:968:11)
        at Socket.emit (events.js:95:17)
        at Pipe.close (net.js:465:12)
        { [Error: C:\Users\Reen\.cordova\lib\android\cordova\3.5.0\bin\create.bat: Command failed with exit code 8] code: 8 }
        [error] C:\Users\Reen\.cordova\lib\android\cordova\3.5.0\bin\create.bat: Command failed with exit code 8
    
    遵循Win7环境变量(用户变量“User”:

    遵循Win7系统变量(系统变量:)

    更新

    好的,我没有正确安装cordova

    在推荐行之后重复该步骤

        npm install -g cordova
    
        and getting the following message now:
    
        E:\Android development\nodejs\mmiapp>phonegap build local android
    
        C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\build.js:83
    
    self.phonegap.emit('log', PG_STR.msgdet[0], platform.human, PG_STR.msgdet[
                                                        ^
        TypeError: Cannot read property 'human' of undefined at BuildCommand.execute (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\build.js:83:57)
        at BuildCommand.run (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\build.js:65:10)
        at PhoneGap.build (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\util\command.js:28:25)
        at CLI.module.exports [as build] (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\cli\build.js:35:14)
        at CLI.module.exports [as argv] (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\cli\argv.js:66:17)
        at Object.<anonymous> (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\bin\phonegap.js:26:21)
        at Module._compile (module.js:456:26)
        at Object.Module._extensions..js (module.js:474:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:312:12)
    

    你能简化你的代码和描述吗?太笨重的Cordova在清除错误消息时简直糟透了。第一个错误是由于您没有安装ApacheAnt。你安装好了吗?其次,您是否创建了任何android目标?@ivarni:是的,特别是对于第一次看到它的用户:S我没有直接安装ant,而是将其解压缩到本地驱动器,并将其作为系统变量添加到路径中(Sys configurations->system->Advanced Sys options->Sys path)-->查看我对初始问题的更新。@ivarni如果你是指“android目标文件夹/应用程序路径,是的,我有它在”nodejs/myapp“中。否则我不知道你的意思。Sry Newbe这里…:(这种android目标:
        "Android_Home": E:\Android development\sdk
        "SDK": E:\Android development\sdk\tools
        "Ant_Home": C:\Program Files\apache-ant-1.9.4
        "JDK_Home": C:\Program Files\Java\jdk1.8.0_05
    
        E:\Android development\nodejs\;E:\Android development\nodejs\package\Git\cmd; C:\Program Files\Java\jdk1.8.0_05\bin;C:\Program Files\apache-ant-1.9.4\bin
    
        npm install -g cordova
    
        and getting the following message now:
    
        E:\Android development\nodejs\mmiapp>phonegap build local android
    
        C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\build.js:83
    
    self.phonegap.emit('log', PG_STR.msgdet[0], platform.human, PG_STR.msgdet[
                                                        ^
        TypeError: Cannot read property 'human' of undefined at BuildCommand.execute (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\build.js:83:57)
        at BuildCommand.run (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\build.js:65:10)
        at PhoneGap.build (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\util\command.js:28:25)
        at CLI.module.exports [as build] (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\cli\build.js:35:14)
        at CLI.module.exports [as argv] (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\cli\argv.js:66:17)
        at Object.<anonymous> (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\bin\phonegap.js:26:21)
        at Module._compile (module.js:456:26)
        at Object.Module._extensions..js (module.js:474:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:312:12)
    
        e:\Android development\nodejs\mmiapp>npm install -g apache ant
        
        npm WARN engine ant@0.2.0: wanted: {"node":"~0.8.0"} (current:
        {"node":"v0.10.29 ","npm":"1.4.14"})
        ant@0.2.0 C:\Users\Reen\AppData\Roaming\npm\node_modules\ant`