replugin java8降级到java7踩坑
replugin 框架不支持java8编译所以必须降到java7
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
如果依赖项目或者aar有使用java8编译,那么在编译的时候就会提示
Invoke-customs are only supported starting with Android O (–min-api 26)
Message{kind=ERROR, text=Invoke-customs are only supported starting with Android O (–min-api 26), sources=[Unknown source file], tool name=Optional.of(D8)}
AGPBI: {“kind”:“error”,“text”:“Invoke-customs are only supported starting with Android O (–min-api 26)”,“sources”:[{}],“tool”:“D8”}
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.
The dependency contains Java 8 bytecode. Please enable desugaring by adding the following to build.gradle
an