【问题标题】:Ionic Background Geolocation plugin causes error when buildingIonic Background Geolocation 插件在构建时导致错误
【发布时间】:2017-11-17 18:37:17
【问题描述】:

我有一个运行良好的 Ionic 2 应用程序。现在我进行了更新,当我尝试构建 APK 时出现错误。

* What went wrong:
        Execution failed for task ':transformClassesWithJarMergingForRelease'.
        > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: 
        com/google/android/gms/iid/zzc.class

错误告诉我问题,但我不知道如何解决。我必须在哪里删除重复项?

这与 Ionic Background Geolocation 插件有关,因为如果我删除该插件,问题就会消失。

【问题讨论】:

    标签: cordova ionic-framework


    【解决方案1】:

    后台地理定位插件depends on the Play Services library 和您在上面发布的错误消息表明 Gradle 配置中指定的 Play Services 库版本不匹配(see here 表示类似错误)。可能的原因是您的项目中有另一个插件指定了不同的 Play Services 版本。后台地理定位插件指定+,即最新版本(v11.6.0)。

    一种可能的解决方案是将cordova-android-play-services-gradle-release 插件安装到您的项目中,它会尝试覆盖插件指定的版本以解决版本冲突。

    后台地理定位插件also depends on the Android Support library,所以在修复播放服务问题后,您可能会遇到类似的问题。如果是这样,您可以尝试使用 cordova-android-support-gradle-release 在 Gradle 配置中执行类似的覆盖。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-01-11
      • 1970-01-01
      • 2016-05-24
      • 1970-01-01
      • 2016-12-12
      • 2020-05-06
      • 2021-02-06
      相关资源
      最近更新 更多