After Updating to the gradle 3.1.4 and moving to buildToolsVersion "27.0.3"
I'm Facing this issues
android.view.InflateException: Binary XML file line #41: Binary XML file line #41: Error inflating class ImageView
Caused by: android.view.InflateException: Binary XML file line #41: Error inflating class ImageView
Caused by: android.content.res.Resources$NotFoundException: Drawable com.demo.android:drawable/ic_demo with resource ID #0x7f080160
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/ic_demo.xml from drawable resource ID #0x7f080160
I tried to replace android:src to app:srcCompat and added vectorDrawables.useSupportLibrary = true in defaultConfig
Below is the layout file code
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/demo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_demo"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:visibility="gone" />
</RelativeLayout>
UPDATE: I found an issue. issue is some of the vector are working and some of them are not supported though they are created in SVG format from same sources. Can anyone suggest me to convert the PNG to SVG FILE.
/ic_demois inres/drawablefolder not indrawable-v24AppCompatImageViewrather thanImageView, that might solve your issue.