无法在 android 上构建应用程序 ionic [英] Impossible to build app ionic on android

查看:33
本文介绍了无法在 android 上构建应用程序 ionic的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我长期以来一直致力于一个 ionic 项目.

I've been working on a project with ionic from a long time.

最近我更新了 android studio 和它的包,现在我不能再在 android 上构建了,因为以下问题:

Recently i updated android studio and it's packages and now i can't build on android anymore because of the following issue:

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com/google/android/gms/iid/zzc.class

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/iid/zzc.class

在更新 android studio 之前一切正常.

Before updating android studio everything worked well.

这是一个带有cordova android引擎6.1.2的ionic v1应用.

This is a ionic v1 app with cordova android engine 6.1.2.

我使用的是cordova 6.5.0,ionic 2.2.1.

I'm using cordova 6.5.0, ionic 2.2.1.

我的android环境:sdk工具25.2.3,sdk平台工具26,sdk构建工具26

My android environment: sdk tools 25.2.3, sdk platform tools 26, sdk build tools 26

你知道为什么我在编译时总是出现这个错误吗?

Do you have any idea why i keep getting this error when compiling?

推荐答案

该错误是由不同插件请求的 Play 服务库版本冲突引起的.

That error is being caused by conflicting versions of the Play Services library being requested by different plugins.

最快的修复方法是安装 cordova-android-play-services-gradle-release 到您的 Cordova 项目中,这将强制 Gradle 对齐版本:

Quickest way to fix is to install cordova-android-play-services-gradle-release into your Cordova project which will force Gradle to align the versions:

cordova plugin add cordova-android-play-services-gradle-release

这篇关于无法在 android 上构建应用程序 ionic的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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