Static interface methods are only supported starting with Android N (--min-api 24): void butterkn...

使用ButterKnife gradle正常,编译失败,报错:

> Transform butterknife-runtime.aar (com.jakewharton:butterknife-runtime:10.1.0) with DexingTransform
AGPBI: {"kind":"error","text":"Static interface methods are only supported starting with Android N (--min-api 24): void butterknife.Unbinder.lambda$static$0()","sources":[{}],"tool":"D8"}

解决办法:
在app module的build.gradle中添加:

android {
  // ...
  compileOptions {
      sourceCompatibility JavaVersion.VERSION_1_8
      targetCompatibility JavaVersion.VERSION_1_8
 }
// ... 
}

参考:https://github.com/JakeWharton/butterknife/issues/1386

你可能感兴趣的:(Static interface methods are only supported starting with Android N (--min-api 24): void butterkn...)