安卓程序运行在6.0版本上出错

2019-01-02 22:52发布

提示信息里有如下提示.看不太懂,有大佬可以帮忙看看嘛

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

标签: 安卓 java
1条回答
再贱就再见
2楼-- · 2019-01-02 23:28

https://stackoverflow.com/questions/42060702/before-android-4-1-method-android-graphics-porterduffcolorfilter-would-have

Android used to run on Dalvik VM.

Dalvik had a bug allowing classes to override parent's package-private methods.

So when they switched to ART, they fixed this, so it no longer overrides the parent's method, Now when such a scenario is detected, it logs a warning, making sure you're aware of the behavior change.

It seems that some support-lib classes (PorterDuffColorFilterVectorDrawableCompat) have such scenario, so ART notifies you.

I think it's safe to ignore this, unless this is your own code, in which case I would either change the method's name, or test on Android running Dalvik (pre-4.1) and running ART (4.1+)

查看更多
登录 后发表回答