Binary XML file line #17: Error inflating class <unknown> caused by UnsupportedOperationException: Can't convert to dimension: type=0x2

爷,独闯天下 提交于 2019-12-01 15:20:59

error in xml
check that you are in line 17 of your submission.

android:attr/textAppearanceListItemSmall
if the error here is api level change in the manifest

The innermost exception means that one of your textviews have invalid dimensions declared. Check the SDK level you are using, because android:attr/listPreferredItemHeightSmall and android:attr/textAppearanceListItemSmall are available from API level 14 and up.

(added from my comment which fixed the issue)

I found the same error on the same line, and it took two days to identify what the error was.

The error was simply because I was trying to use one: android:background

Rather than: app:srcCompat

in an SVG file.

In your case,

<ImageView android:id="@+id/icon"   
        android:layout_width="25dp"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_marginLeft="12dp"
        android:layout_marginRight="12dp"
        android:src="@drawable/menu_tip"   <-- the error is here
        android:layout_centerVertical="true"/>

the error also appears if you are using: android:src=" "

I hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!