Vladyslav Vladyslav - 3 months ago 216
Android Question

Cannot resolve symbol abc_ic_search_api_mtrl_alpha

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.

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.

Modify abc_ic_ab_back_mtrl_am_alpha to abc_ic_ab_back_material

Edit: In 23.2.1 the name of the component was changed back to abc_ic_ab_back_mtrl_am_alpha

Edit: In 24.0.0 the name of the component was changed to: abc_ic_ab_back_material

All you need to do is to change name abc_ic_search_api_mtrl_alpha to abc_ic_ab_search_material

It should work