Search code examples
androidandroid-layoutandroid-imageview

RuntimeException : Width (0) and height (0) cannot be <= 0


I have got this type of error, How may I resolve this issue.

java.lang.RuntimeException: java.lang.RuntimeException: Error while processing D:\Android Project\AttendanceApp\app\src\main\res\drawable\ic_arrow_back.xml : Width (0) and height (0) cannot be <= 0

ic_arrow_back.xml

<vector android:height="@dimen/_25sdp" android:tint="#FFFFFF"
    android:viewportHeight="24.0" android:viewportWidth="24.0"
    android:width="@dimen/_25sdp" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="#FF000000" android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>

Solution

  • You need to add certain attributes on your app's build.gradle.

    android {  
       defaultConfig {  
         vectorDrawables.useSupportLibrary = true  
        }  
     }