Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble with resources from appcompat-v7:22.2.0 in Android Studio

We've got a base project from University to build upon. So I installed Android Studio, installed and updated the Android SDK (API 22) and the all the extras and opened the project, which has the appcompat-v7 library included under External Libraries.
When I'm trying to build the app I get the following error messages:

C:\PRIVAT\Universität Regensburg\SS-2015\Anwendungsprogrammierung-mit-Android\Studienleistungen\02-Studienleistung\FoodieAppStarterProject\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\22.2.0\res\layout\notification_media_cancel_action.xml
Error:(26, 18) No resource found that matches the given name (at 'src' with value '@drawable/abc_ic_clear_mtrl_alpha').
C:\PRIVAT\Universität Regensburg\SS-2015\Anwendungsprogrammierung-mit-Android\Studienleistungen\02-Studienleistung\FoodieAppStarterProject\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\22.2.0\res\drawable\abc_btn_check_material.xml
Error:(18, 58) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_btn_check_to_on_mtrl_015').
Error:(19, 29) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_btn_check_to_on_mtrl_000').

... and so on. I get lots and lots of these. And I have no idea why. Everything seems to be correct.

Can anyone help based on this.

like image 298
Mister Jingles Avatar asked Jun 04 '15 21:06

Mister Jingles


1 Answers

As you can see here: https://developer.android.com/sdk/support_api_diff/23.2.0/changes/android.support.v7.appcompat.R.drawable.html

The drawable reference had been updated, so you need to update the variable name:

abc_ic_clear_mtrl_alpha      -> abc_ic_clear_material
abc_btn_check_to_on_mtrl_015 -> abc_btn_checkbox_checked_mtrl
abc_btn_check_to_on_mtrl_000 -> abc_btn_checkbox_unchecked_mtrl
abc_ic_ab_back_mtrl_am_alpha -> abc_ic_ab_back_material

But, you should notice, if you use these resources on devices with API level <= 19. That will trigger an exception Resource Not Found.

like image 130
MewX Avatar answered Oct 29 '22 04:10

MewX