美文网首页Android代码封装
Static interface methods are onl

Static interface methods are onl

作者: 清风流苏 | 来源:发表于2019-03-29 11:23 被阅读85次

使用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 onl

    本文链接:https://www.haomeiwen.com/subject/bptlbqtx.html