问题
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