包含在Android项目的库重复类 [英] Duplicate class contained in the libs of android project

查看:139
本文介绍了包含在Android项目的库重复类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我试图使用Android Studio来调试我的项目,我得到了下面的错误,

com.google.ads.AdRequest.Gender 已经被添加到输出。请删除重复的副本。

原因似乎是谷歌的播放服务lib和我的项目使用的另一个lib中都包含 com.google.ads.AdRequest.Gender 类和< STRONG>我不认为我可以从任何一个删除它。

有谁知道如何解决这个问题呢?

非常感谢。

我试过的build.gradle下面的语句,以排除在谷歌发挥服务lib中复制类,但它仍然没有解决问题。

 编译('com.google.android.gms:发挥服务:4.1.32'){
    排除组:com.google.ads
}


解决方案

不过,我来到谷歌通过这篇文章,我读了这篇文章有同样的问题,因为我。我解决了它不包括组和整个图书馆。在我的情况,问题是与animatorListener。

 编译('com.rengwuxian.materialedittext:库:1.8.2'){
    排除组:com.nineoldandroids',模块:图书馆
}

这是我的文章<一个href=\"http://stackoverflow.com/questions/28297249/duplicate-library-gradle-animatorlistener-duplicate/28298042?noredirect=1#comment44948666_28298042\">duplicate库gradle这个animatorlistener重复

When I was trying to use Android Studio to debug my project, I got the following error,

Class com.google.ads.AdRequest.Gender has already been added to output. Please remove duplicate copies.

The cause seems to be that the google play services lib and another lib used by my project both contain the com.google.ads.AdRequest.Gender class, and I don't think I can remove it from either one.

Does anyone know how to fix this problem?

Thanks a lot.

I tried the following statement in build.gradle in order to exclude the duplicated classes in the google play services lib, but it still does not solve the problem.

compile ('com.google.android.gms:play-services:4.1.32') {
    exclude group: 'com.google.ads'
}

解决方案

But I came to this post via google and I read this post has the same problem as me. I solved it excluding the group and the whole library. In my case the problem was with an animatorListener.

compile ('com.rengwuxian.materialedittext:library:1.8.2'){
    exclude group: 'com.nineoldandroids', module: 'library'
}

This is my post duplicate library gradle animatorlistener duplicate

这篇关于包含在Android项目的库重复类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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