Android 10需要使用最新版本10.0.0的ButterKnife

在app的build.gradle的dependencies添加如下代码

implementation "com.jakewharton:butterknife:10.0.0"
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'

如果遇到Static interface methods are only supported starting with Android N (--min-api 24):void butterknife.Unbinder.lambda$static$0()这个错误的话,在app的build.gradle的android里添加如下代码 

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

 参考地址:AndroidX下的两个坑

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2021-08-07
  • 2021-09-21
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-10
  • 2021-07-11
  • 2021-04-13
  • 2021-04-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
相关资源
相似解决方案