phonegap运行android时出现错误信息

时间:2014-04-03 03:27:29

标签: android cordova

我想在设备上运行我的应用。但我无法运行它,因为在使用此命令phonegap运行android时,此消息提醒。

 This is the message shows during i run android in phonegap. 



 c:\project\resource_map_phonegap>phonegap run android
    [phonegap] detecting Android SDK environment...
    [phonegap] using the local environment
    [phonegap] compiling Android...
    [ReferenceError: a is not defined]

    module.js:340
        throw err;
              ^
    Error: Cannot find module './spawn'
        at Function.Module._resolveFilename (module.js:338:15)
        at Function.Module._load (module.js:280:25)
        at Module.require (module.js:364:17)
        at require (module.js:380:17)
        at Object.<anonymous> (c:\project\resource_map_phonegap\platforms\android\co
    rdova\lib\build.js:23:15)
        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)
        at Module.require (module.js:364:17)
       [error] cmd: Command failed with exit code 8

1 个答案:

答案 0 :(得分:0)

我找到解决此问题的唯一方法是删除Android平台并重新添加它(确保先将其他地方复制到Android文件夹中,以防万一):

cordova platform remove android

cordova platform add android

之后你应该能够建立起来。只需确保添加任何可能被删除的Android插件或本机代码。

相关问题