【问题标题】:Cordova build Error for Android So i can't build my solutionCordova 为 Android 构建错误所以我无法构建我的解决方案
【发布时间】:2018-02-09 02:38:14
【问题描述】:

我遇到了很多这样的错误,所以我无法构建我的项目! 我正在使用视觉工作室 2015。 这个错误是什么意思? 我该如何解决这个问题?

enter image description here

1>  ------ Version from source package.json: 1.0.42
1>  ------ Package already installed globally at correct version.
1>  ------ Cordova tools 8.0.0 already installed.
1>MSBUILD : cordova-build error : C:\Users\Anna\AppData\Roaming\npm\node_modules\cordova\node_modules\json-parse-better-errors\index.js:9
1>  C:\Users\Anna\AppData\Roaming\npm\node_modules\cordova\node_modules\json-parse-better-errors\index.js:9
1>MSBUILD : cordova-build error :  const syntaxErr = e.message.match(/^Unexpected token.*position\s+(\d+)/i)
1>      const syntaxErr = e.message.match(/^Unexpected token.*position\s+(\d+)/i)
1>MSBUILD : cordova-build error :  ^^^^^
1>      ^^^^^
1>MSBUILD : cordova-build error : SyntaxError: Use of const in strict mode.
1>  SyntaxError Use of const in strict mode.
1>MSBUILD : cordova-build error :  at exports.runInThisContext (vm.js:73:16)
1>      at exports.runInThisContext (vm.js:73:16)
1>MSBUILD : cordova-build error :  at Module._compile (module.js:443:25)
1>      at Module._compile (module.js:443:25)
1>MSBUILD : cordova-build error :  at Object.Module._extensions..js (module.js:478:10)
1>      at Object.Module._extensions..js (module.js:478:10)
1>MSBUILD : cordova-build error :  at Module.load (module.js:355:32)
1>      at Module.load (module.js:355:32)
1>MSBUILD : cordova-build error :  at Function.Module._load (module.js:310:12)
1>      at Function.Module._load (module.js:310:12)
1>MSBUILD : cordova-build error :  at Module.require (module.js:365:17)
1>      at Module.require (module.js:365:17)
1>MSBUILD : cordova-build error :  at require (module.js:384:17)
1>      at require (module.js:384:17)
1>MSBUILD : cordova-build error :  at Object.<anonymous> (C:\Users\Anna\AppData\Roaming\npm\node_modules\cordova\node_modules\read-package-json\read-json.js:12:16)
1>      at Object.<anonymous> (C:\Users\Anna\AppData\Roaming\npm\node_modules\cordova\node_modules\read-package-json\read-json.js:12:16)
1>MSBUILD : cordova-build error :  at Module._compile (module.js:460:26)
1>      at Module._compile (module.js:460:26)
1>MSBUILD : cordova-build error :  at Object.Module._extensions..js (module.js:478:10)
1>      at Object.Module._extensions..js (module.js:478:10)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========

【问题讨论】:

  • 这个问题可能来自 1)"regedit setting"。此外,有可能 2)您尝试将程序文件/android/文件夹移动到 appdata/android/文件夹。我修复了这个问题以重新安装 android studio 并重置与 cordova 相关的系统路径

标签: javascript android cordova visual-studio-2015 visual-studio-cordova


【解决方案1】:

这个问题可能在regedit setting

您正在尝试将program file/android/folders 移动到appdata/android/folders

我通过重新安装android studio并重置与cordova相关的系统路径解决了这个问题。

【讨论】:

    猜你喜欢
    • 2018-03-08
    • 1970-01-01
    • 1970-01-01
    • 2017-02-26
    • 2014-02-06
    • 2011-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多