Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 946
Personal Jesus Avatar asked Aug 12 '16 22:08

Personal Jesus


1 Answers

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

Update

For API version 24.2.1 and greater use below key word.

abc_ic_search_api_material

It will work.

like image 193
piotrek1543 Avatar answered Sep 20 '22 17:09

piotrek1543