最近我们在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
代码编译得很好,但看到很多红色错误很烦人。 有人知道怎么摆脱它们吗?
答案 0 :(得分:0)
如同ADM建议的那样,如果在build.gradle中设置了java 8,它就会得到解决。
compileOptions.with {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
更新: 警告信息再次出现。看起来我很困惑,因为buildCache没有看到这些消息。
问题没有解决。