【问题标题】:Ionic build android failed with plugin errorIonic build android 因插件错误而失败
【发布时间】:2018-12-22 20:26:38
【问题描述】:

我正在运行“Ionic build android”命令并出现以下错误。

cordova-android-support-gradle-release.after-prepare:将自定义版本 '27.+' 写入 C:\Welfare_Research_2009\Development\EC\Main\LmpIonic\platforms\android\build.gradle

cordova-android-support-gradle-release.before-prepare:编写自定义版本 '27.+' 到

C:\Welfare_Research_2009\Development\EC\Main\LmpIonic\platforms\android\cordova-android-support-gradle-release\properties.gradle

Discovered plugin “call-number” in config.xml. Adding it to the project

Failed to restore plugin “call-number” from config.xml. You might need to try adding it again. Error: SyntaxError: Unexpected token  in JSON at position 0

(node:20228) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): SyntaxError: Unexpected token  in JSON at position 0

My Ionic Info is as below
Ionic Framework Version: 3.0.1  
Ionic CLI Version: 2.2.2  
Ionic App Lib Version: 2.2.1  
Ionic App Scripts Version: 1.3.0  
ios-deploy version: Not installed  
ios-sim version: Not installed  
OS: Windows 10  
Node Version: v6.10.0  

我试图从 config.xml 中删除插件,但没有成功。

如果有更多关于此的想法/建议,我们将不胜感激。

【问题讨论】:

    标签: cordova ionic2


    【解决方案1】:

    我在 Cordova 上构建 Android 时遇到了类似的问题。解决方案是安装一个 gradle 插件——你可能有类似的 ionic。 Cordova 插件是:cordova-android-support-gradle-release

    【讨论】:

      【解决方案2】:
      1. ionic cordova 平台移除 android
      2. ionic cordova 插件删除 cordova-plugin-firebase
      3. ionic cordova 平台添加 android

      【讨论】:

        【解决方案3】:

        如果您尝试删除并重新添加插件,直接在 config.xml 中执行可能不是最好的方法。试试这些:

        ionic cordova plugin remove call-number
        ionic cordova plugin add call-number
        

        偶尔需要清除cordova构建问题的其他东西也很常见:

        • 删除/重新添加相关平台
        • 物理删除插件目录

        【讨论】:

          猜你喜欢
          • 2018-03-19
          • 1970-01-01
          • 2016-06-18
          • 1970-01-01
          • 2021-10-24
          • 2018-10-12
          • 2014-10-29
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多