如何修复错误:在butterknife.Unbinder中警告。 :()V:定义静态接口方法需要--min-sdk-version> = 24

问题描述 投票:1回答:1

最近我们在AS 3.0.1中发现了这些警告:

Error:WARNING in butterknife.Unbinder.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: butterknife.Unbinder.<clinit>:()V

Error:WARNING in android.support.v4.widget.AutoSizeableTextView.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: android.support.v4.widget.AutoSizeableTextView.<clinit>:()V
Error:WARNING in io.fabric.sdk.android.InitializationCallback.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: io.fabric.sdk.android.InitializationCallback.<clinit>:()V
Error:WARNING in io.fabric.sdk.android.services.network.HttpRequest$ConnectionFactory.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: io.fabric.sdk.android.services.network.HttpRequest$ConnectionFactory.<clinit>:()V
Error:WARNING in com.squareup.okhttp.logging.HttpLoggingInterceptor$Logger.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: com.squareup.okhttp.logging.HttpLoggingInterceptor$Logger.<clinit>:()V
Error:WARNING in com.bumptech.glide.load.Key.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: com.bumptech.glide.load.Key.<clinit>:()V
Error:WARNING in com.bumptech.glide.load.model.Headers.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: com.bumptech.glide.load.model.Headers.<clinit>:()V
Error:WARNING in com.squareup.picasso.Cache.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: com.squareup.picasso.Cache.<clinit>:()V
Error:WARNING in com.squareup.picasso.Picasso$RequestTransformer.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: com.squareup.picasso.Picasso$RequestTransformer.<clinit>:()V
Error:WARNING in com.squareup.okhttp.Dns.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: com.squareup.okhttp.Dns.<clinit>:()V
Error:WARNING in com.squareup.okhttp.internal.framed.PushObserver.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: com.squareup.okhttp.internal.framed.PushObserver.<clinit>:()V
Error:WARNING in com.squareup.okhttp.internal.io.FileSystem.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: com.squareup.okhttp.internal.io.FileSystem.<clinit>:()V
Error:WARNING in com.layer.lsdka.lsdka.a.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: com.layer.lsdka.lsdka.a.<clinit>:()V
Error:WARNING in com.layer.lsdka.lsdka.c.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: com.layer.lsdka.lsdka.c.<clinit>:()V
Error:WARNING in com.lsdka.lsdka.lsdka.e.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: com.lsdka.lsdka.lsdka.e.<clinit>:()V
Error:WARNING in com.lsdka.lsdka.lsdka.lsdkb.i.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: com.lsdka.lsdka.lsdka.lsdkb.i.<clinit>:()V
Error:WARNING in com.lsdka.lsdka.lsdka.lsdkb.o.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: com.lsdka.lsdka.lsdka.lsdkb.o.<clinit>:()V
Error:WARNING in retrofit.ErrorHandler.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: retrofit.ErrorHandler.<clinit>:()V
Error:WARNING in retrofit.RequestInterceptor.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: retrofit.RequestInterceptor.<clinit>:()V
Error:WARNING in retrofit.RestAdapter$Log.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: retrofit.RestAdapter$Log.<clinit>:()V
Error:WARNING in kotlin.coroutines.experimental.ContinuationInterceptor.<clinit>:()V: defining a static interface method requires --min-sdk-version >= 24 (currently 16) for interface methods: kotlin.coroutines.experimental.ContinuationInterceptor.<clinit>:()V

代码编译得很好,但看到很多红色错误真的很烦人。有人知道怎么摆脱它们吗?

android gradle android-studio-3.0
1个回答
0
投票

正如ADM建议的那样,如果在build.gradle中设置了java 8,它就会得到解决。

compileOptions.with {
  sourceCompatibility = JavaVersion.VERSION_1_8
  targetCompatibility = JavaVersion.VERSION_1_8
}

更新:再次出现警告消息。看起来我很困惑,因为buildCache没有看到这些消息。

问题没有解决。

© www.soinside.com 2019 - 2024. All rights reserved.