So in my project I was using standard material search icon in action bar.
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/search" android:title="@string/action_search" android:icon="@drawable/abc_ic_search_api_mtrl_alpha" app:showAsAction="collapseActionView|ifRoom" app:actionViewClass="android.support.v7.widget.SearchView" /> </menu>
But if I update libreries from 23.0.1 to 24.1.1 Android Studio says:
Cannot resolve symbol abc_ic_search_api_mtrl_alpha
Why is that? I searched in google but didn’t find answer.
I’ve found an similar issue on StackOverflow: error: cannot find symbol variable abc_ic_ab_back_mtrl_am_alpha
The answer for topic above is:
The name of the resource was changed in the 23.2.0 support library.
Edit: In 23.2.1 the name of the component was changed back to
Edit: In 24.0.0 the name of the component was changed to:
All you need to do is to change name
It should work
For API version 24.2.1 and greater use below key word.
It will work.
You can import the ‘back’ and ‘search’ material icons as vector drawables.
You can then customize the color of the drawable using DrawableCompat.setTint(). Not only is this more flexible but it will also no break in future support libraries updates.