在 Android 4.1 之前,方法 android.graphics.PorterDuffColorFilter --- 会错误地覆盖包

2022-09-02 01:34:55

我正在使用导航和.当我要运行这个应用程序时,我得到这个错误。drawer activity android studioFirebase Authentication

  W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable

我也使用最低版本的SDK和构建工具...

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
}

答案 1

安卓曾经运行在 .Dalvik VM

Dalvik有一个错误,允许类重写父级的包私有方法。

因此,当他们切换到 时,他们修复了这个问题,因此它不再覆盖父级的方法,现在当检测到这种情况时,它会记录警告,确保您知道行为更改。ART

似乎有些类(,)有这样的场景,所以通知你。support-libPorterDuffColorFilterVectorDrawableCompatART

我认为忽略这一点是安全的,除非这是你自己的代码,在这种情况下,我会改变方法的名称,或者在Android上运行(4.1之前)和运行(4.1 +)进行测试DalvikART


答案 2

推荐