W/dalvikvm: VFY:无法解析静态字段。

时间:2022-09-04 10:19:30

Could someone explain this logcat message? (and suggest a way to remove it?)

有人能解释这个logcat信息吗?(并建议一种方法去除它?)

W/dalvikvm: VFY: unable to resolve static field 54 (ADD)
in Landroid/graphics/PorterDuff$Mode;

(Note: I have no idea wha's causing it, so I don't know what else portion of the app to inspect, and I am using a SurfaceView to draw VectorDrawableCompat on the Canvas)

(注意:我不知道wha的原因是什么,所以我不知道该应用程序的其他部分要检查什么,我正在使用一个SurfaceView在画布上绘制VectorDrawableCompat)

Thank you for reading my question.

谢谢你阅读我的问题。

1 个解决方案

#1


1  

Could someone explain this logcat message?

有人能解释这个logcat信息吗?

You have code that is conditionally using PorterDuff.Mode.ADD. For whatever reason, that does not exist in the framework on your Android device. That is rather odd, as that field should have existed since API Level 1, if the documentation is correct.

您的代码有条件地使用PorterDuff.Mode.ADD。不管出于什么原因,在Android设备的框架中不存在这种情况。这是相当奇怪的,因为如果文档是正确的,那么该字段应该存在于API级别1之后。

and suggest a way to remove it?

并且建议一种移除它的方法?

In general, you don't. This is a warning, not an error. You will get lots of these warnings, any time that you are using code that will use newer methods and classes on newer devices but gracefully degrade to avoid them on older devices. This approach is standard fare for Android development, whether you do the graceful degradation yourself or get it as part of an Android Support library.

一般来说,你不。这是一个警告,不是错误。您将得到许多这样的警告,任何时候您使用的代码将在更新的设备上使用更新的方法和类,但是在较旧的设备上优雅地降级以避免它们。这种方法是Android开发的标准费用,无论你自己做的是优雅的降级,还是作为Android支持库的一部分。

#1


1  

Could someone explain this logcat message?

有人能解释这个logcat信息吗?

You have code that is conditionally using PorterDuff.Mode.ADD. For whatever reason, that does not exist in the framework on your Android device. That is rather odd, as that field should have existed since API Level 1, if the documentation is correct.

您的代码有条件地使用PorterDuff.Mode.ADD。不管出于什么原因,在Android设备的框架中不存在这种情况。这是相当奇怪的,因为如果文档是正确的,那么该字段应该存在于API级别1之后。

and suggest a way to remove it?

并且建议一种移除它的方法?

In general, you don't. This is a warning, not an error. You will get lots of these warnings, any time that you are using code that will use newer methods and classes on newer devices but gracefully degrade to avoid them on older devices. This approach is standard fare for Android development, whether you do the graceful degradation yourself or get it as part of an Android Support library.

一般来说,你不。这是一个警告,不是错误。您将得到许多这样的警告,任何时候您使用的代码将在更新的设备上使用更新的方法和类,但是在较旧的设备上优雅地降级以避免它们。这种方法是Android开发的标准费用,无论你自己做的是优雅的降级,还是作为Android支持库的一部分。