1重复引用包过滤
在app.gradle中添加packagingOptions
android {
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/rxjava.properties'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LGPL2.1'
}
}
2.编译后运行出现找不到的问题
annotationProcessor
implementation
app.gradle需要改为kapt的引用
apply plugin: 'kotlin-kapt'
android {
...
defaultConfig {
//编译时注解,epoxy和glide冲突
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
}
}
}
kapt {
arguments {
arg("moduleName", project.getName())
}
}
}
dependencies {
...
implementation rootProject.ext.dependencies["epoxy"]
kapt rootProject.ext.dependencies["epoxyProcessor"]
...
}
3.app引用lib中的库,在lib中需要使用api方式,使用implementation方式只能在lib中访问
api 'com.github.dueeeke.dkplayer:ijk-armv7a:3.0.2'
网友评论