Program type already present during compile

天大地大妈咪最大 提交于 2019-12-11 18:32:17

问题


I have some strange situation during build time. Here is message:

Program type already present: org.simpleframework.xml.Attribute

dependencies {
    implementation 'com.android.support:multidex:1.0.1'
    implementation 'com.android.support:appcompat-v7:25.4.0'
    implementation 'com.google.android.gms:play-services:11.8.0'
    implementation 'com.google.gms:google-services:3.3.1'
    implementation 'com.facebook.fresco:fresco:0.6.0'

    implementation files('libs/activation.jar')
    implementation files('libs/additionnal.jar')
    implementation files('libs/mail.jar')

    implementation project(':CouponingModule')
    implementation 'com.google.firebase:firebase-messaging:11.8.0'
    // https://mvnrepository.com/artifact/org.simpleframework/simple-xml
    implementation('org.simpleframework:simple-xml:2.7.1') {
        exclude group: 'stax', module: 'stax-api'
        exclude group: 'xpp3', module: 'xpp3'
    }
}

回答1:


The reason is that some libraries have similar dependencies, therefore the compiler can not choose the appropriate one.




回答2:


This is probably because you're using the following:

 implementation 'com.google.gms:google-services:3.3.1'

which is not a dependency but a plugin. it should be placed to your root / project build.gradle. Something like this:

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {

        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:3.3.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}


来源:https://stackoverflow.com/questions/50291152/program-type-already-present-during-compile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!