复制的gradle库重复animatorlistener [英] duplicate library gradle animatorlistener duplicate

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

问题描述

我试图用一些库到我的Andr​​oid项目,我面临的一些问题与不同的库。我有我从标有nineoldandroids库依赖Maven仓库导入库。之后,我有一个使用相同的库的另一个进口和我做了一个排除模块。现在,如果我同步摇篮一切工作正常,但是当我尝试运行我的应用程序我碰到下面的错误

 错误:类com.nineoldandroids.animation.Animator.AnimatorListener已经被添加到输出请删除重复的副本。

我认为,这两个库试图使用同一个监听器,我得到这个错误,但我不能够解决这个问题,我没有找到有用的信息给我。如果有人能帮助我,我将AP preciate它。这是我的文件的gradle。 BTW最后库必须手动包括在内,它被放置在我的库文件夹中。

 应用插件:'com.android.application安卓{
    compileSdkVersion 21
    buildToolsVersion21.1.1    defaultConfig {
        的applicationIDcom.infortec.acostela.pescamerca
        19的minSdkVersion
        targetSdkVersion 21
        版本code 1
        的versionName1.0
    }
    buildTypes {
        发布 {
            minifyEnabled假
            proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard-rules.pro
        }
    }
    库{
        jcenter()
        flatDir {
           迪尔斯'库'
        }
    }
    dexOptions {
        preDexLibraries = FALSE
    }
}依赖{
    编译文件树(包括:['的* .jar'],DIR:库)
    编译com.android.support:appcompat-v7:21.0.+
    编译com.android.support:gridlayout-v7:18.0.+
    编译com.j256.ormlite:ormlite核心:4.48
    编译com.j256.ormlite:ormlite-机器人:4.48
    编译公地网:公网:3.3
    编译net.sf.opencsv:opencsv:2.3
    编译com.rengwuxian.materialedittext:库:1.8.2
    编译('libs.example:材料:0.4.3@aar'){
        排除模块:'nineoldandroids
    }
 }


解决方案

最后我解决它。

问题是,我必须排除整个图书馆,不仅模块所以写下面解决它。

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

I'm trying to use some libraries into my android project and I'm facing some problems with different libraries. I have a library which I import from maven repository that has "nineoldandroids" library dependency. After that I have another import that uses the same library and I did a exclude of that module. Now if I sync Gradle everything works fine but when I try to run my app I get the following error

"Error:Class com.nineoldandroids.animation.Animator.AnimatorListener has already been added to output. Please remove duplicate copies."

I think that both libraries are trying to use the same Listener and I get that error but I'm not able to solve it and I didn't find useful information for me. If somebody can help me I would appreciate it. This is my gradle file. BTW last library must be manually included and it's placed in my "libs" folder.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.1"

    defaultConfig {
        applicationId "com.infortec.acostela.pescamerca"
        minSdkVersion 19
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    repositories{
        jcenter()
        flatDir {
           dirs 'libs'
        }
    }
    dexOptions {
        preDexLibraries = false
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:21.0.+'
    compile "com.android.support:gridlayout-v7:18.0.+"
    compile 'com.j256.ormlite:ormlite-core:4.48'
    compile 'com.j256.ormlite:ormlite-android:4.48'
    compile 'commons-net:commons-net:3.3'
    compile 'net.sf.opencsv:opencsv:2.3'
    compile 'com.rengwuxian.materialedittext:library:1.8.2'
    compile ('libs.example:material:0.4.3@aar'){
        exclude module: 'nineoldandroids'
    }
 }

解决方案

Finally I solved it.

The problem was that I must exclude the whole library, not only the module so writing the following solved it.

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

这篇关于复制的gradle库重复animatorlistener的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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