Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

abc_ic_ab_back_material resource not found in support library 23.2.1

After updating android support library 23.2.0 to 23.2.1 there is an error of R.drawable.abc_ic_ab_back_material not found.

What is the updated resource used in version 23.2.1 ?

like image 984
Sayem Avatar asked Mar 13 '16 04:03

Sayem


3 Answers

After researching some time I found that in version 23.2.1 google again introduced the drawable R.drawable.abc_ic_ab_back_mtrl_am_alpha which is removed in 23.2.0.

So, changing to R.drawable.abc_ic_ab_back_mtrl_am_alpha from R.drawable.abc_ic_ab_back_material solve my problem.

like image 107
Sayem Avatar answered Nov 09 '22 09:11

Sayem


1- Use R.drawable.abc_ic_ab_back_material instead of R.drawable.abc_ic_ab_back_mtrl_am_alpha

2- in your build.gradle add the bellow value:

// Gradle Plugin 2.0+  

android {  
   defaultConfig {  
     vectorDrawables.useSupportLibrary = true  
    }  
 }

3- Use "srcCompat" attr instead of "src" in all xml:

<ImageButton xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/back_button_bar"
      app:srcCompat="@drawable/abc_ic_ab_back_material"/>

don't forget to use another attr resource like this xmlns:app="http://schemas.android.com/apk/res-auto"

4- Add next line in your application class

AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);

5- Google recomend copy the R.drawable.abc_ic_ab_back_material and paste in your project.

source: https://android-developers.googleblog.com/2016/02/android-support-library-232.html

like image 37
pablopatarca Avatar answered Nov 09 '22 09:11

pablopatarca


I had the same problem with my vector drawables. I used image vector drawable importer tool of Android Studio. it makes the object in

res>anydpi>myobject.xml

The problem solved by copying the drawable into

res>drawable

Folder.

like image 1
Omid Heshmatinia Avatar answered Nov 09 '22 11:11

Omid Heshmatinia