cordova构建android和离子构建android结果为“SyntaxError:Unexpected token”蓝屏后 [英] cordova build android and ionic build android results in "SyntaxError: Unexpected token" after bluescreen

查看:703
本文介绍了cordova构建android和离子构建android结果为“SyntaxError:Unexpected token”蓝屏后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用cordova build android构建了我的应用程序(cordova,ionic)。虽然它是构建我得到一个蓝屏..现在我无法构建应用程序,而不是离子构建...或科尔多瓦构建......

I've builded my app (cordova, ionic) using "cordova build android". But while it was build I get a blue screen.. now i can't build the app, not with "ionic build..." or "cordova build..."

我已经使用npm更新了nodeJS,cordova和ionic ..但是仍然会出现同样的错误,我甚至已经从今天早上恢复了我的每日备份,错误仍然存​​在。

I've updated nodeJS, cordova and ionic using npm.. but still get the same error, I even have restored my daily backup from today morning, the error stays.

错误:

C:\***\DEV\App\flugdeck>cordova build android

Running command: "C:\Program Files\nodejs\node.exe" "C:\***\DEV\App\flugdeck\hooks\before_prepare\01_jshint.js" "C:\***\DEV\App\flugdeck"

Linting www/js/app.js
File www/js/app.js has no errors.
-----------------------------------------
Linting www/js/config.js
File www/js/config.js has no errors.
-----------------------------------------
Linting www/js/controllers.js
File www/js/controllers.js has no errors.
-----------------------------------------
Linting www/js/controller_flightlog.js
File www/js/controller_flightlog.js has no errors.
-----------------------------------------
Linting www/js/controller_infotools.js
File www/js/controller_infotools.js has no errors.
-----------------------------------------
Linting www/js/controller_timetools.js
File www/js/controller_timetools.js has no errors.
-----------------------------------------
Linting www/js/directives.js
File www/js/directives.js has no errors.
-----------------------------------------
Linting www/js/factories.js
File www/js/factories.js has no errors.
-----------------------------------------
Linting www/js/filters.js
File www/js/filters.js has no errors.
-----------------------------------------
Linting www/js/mymodules.js
File www/js/mymodules.js has no errors.
-----------------------------------------
Linting www/js/services.js
File www/js/services.js has no errors.
-----------------------------------------
Linting www/js/templates.js
File www/js/templates.js has no errors.
-----------------------------------------

SyntaxError: Unexpected token
    at Object.parse (native)
    at Function.PlatformJson.load (C:\Users\MyUserName\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\util\PlatformJson.js:35:21)
    at Object.handlePrepare (C:\Users\MyUserName\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\prepare.js:48:37)
    at C:\Users\MyUserName\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\prepare.js:105:21
    at Array.map (native)
    at C:\Users\MyUserName\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\prepare.js:70:40
    at _fulfilled (C:\Users\MyUserName\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
    at self.promiseDispatch.done (C:\Users\MyUserName\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
    at Promise.promise.promiseDispatch (C:\Users\MyUserName\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749:13)
    at C:\Users\MyUserName\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:557:44


推荐答案


  1. Backup vom kompletten Projektordner erstellen

  2. mit cordova platform rm android diePlattformunterstützungfürAndroidentfernen

  3. den physikalischen Ordner projektroot / platforms / android entfernen

  4. mit cordova platform添加android wieder Platformunterstützunghinzufügen

  5. mit cordova运行android einmal laufen lassen

  6. aus dem备份模具AndroidManifest.xml in den platforms / android-Ordner kopierenundüberschreiben

  7. mit cordova build android die debug.apk erstellen lassen

  1. Backup vom kompletten Projektordner erstellen
  2. mit cordova platform rm android die Plattformunterstützung für Android entfernen
  3. den physikalischen Ordner projektroot/platforms/android entfernen
  4. mit cordova platform add android wieder die Platformunterstützung hinzufügen
  5. mit cordova run android einmal laufen lassen
  6. aus dem Backup die AndroidManifest.xml in den platforms/android-Ordner kopieren und überschreiben
  7. mit cordova build android die debug.apk erstellen lassen






我找到了解决方法


I've found a workaround


  1. 备份完整的应用程序文件夹

  2. 删除Android支持从应用程序使用命令cordova platform remove android

  3. 删除文件夹root / platforms / android

  4. 使用命令cordova添加平台支持平台添加android

  5. 使用命令运行一次cordova run android

  6. 将备份中的现有AndroidManifest.xml复制并覆盖为 root / platforms / android-Folder

  7. 运行命令cordova build android

  1. Backup your complete App-Folder
  2. Remove Android Support from the app with command "cordova platform remove android"
  3. Delete the folder root/platforms/android
  4. Add Platform Support with command "cordova platform add android"
  5. Run it once with command "cordova run android"
  6. Copy and overwrite existing "AndroidManifest.xml" from your Backup into "root/platforms/android"-Folder
  7. Run command "cordova build android"

这篇关于cordova构建android和离子构建android结果为“SyntaxError:Unexpected token”蓝屏后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆