程序类型在编译期间已经存在
Program type already present during compile
我在构建期间遇到了一些奇怪的情况。
这是消息:
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'
}
}
原因是有些库有类似的依赖关系,所以编译器无法选择合适的。
这可能是因为您正在使用以下内容:
implementation 'com.google.gms:google-services:3.3.1'
这不是依赖项而是 插件 。它应该放在你的根目录/项目 build.gradle
。像这样:
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
}
}
我在构建期间遇到了一些奇怪的情况。 这是消息:
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'
}
}
原因是有些库有类似的依赖关系,所以编译器无法选择合适的。
这可能是因为您正在使用以下内容:
implementation 'com.google.gms:google-services:3.3.1'
这不是依赖项而是 插件 。它应该放在你的根目录/项目 build.gradle
。像这样:
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
}
}