我升级butterknife
到 10.1.0 会引发此错误:
Execution failed for task ':app:mergeDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform artifact 'butterknife-runtime.aar (com.jakewharton:butterknife-runtime:10.1.0)' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=19}
> Execution failed for DexingTransform: /Users/<REMOVED>/.gradle/caches/transforms-2/files-2.1/65b6816001722128222b6880d16907c6/jars/classes.jar.
> Error while dexing.
所以我添加到 build.gradle:
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
但是,它minSdkVersion
是 19,但如果我没记错的话,Java 8 需要 API >= 26。
只是为了测试,当我尝试使用像stream
编译器这样的 Java 8 功能时,会按预期显示错误:
Call requires API level 24 (current min is 19): java.util.Collection#stream
项目编译没有错误,但是在尝试使用 Java 8 语言功能的低 Android 版本上,butterknife 会在运行时使应用程序崩溃吗?