Error in lib support appcompat_v7

I'm having problems with the appcompat_v7 library

He has a mistake on the way

RES / values-V21 / styles_base.xml

and line 75 shows the error - below 75 ... 78:

<style name="Base.Widget.AppCompat.ActionButton" parent="android:Widget.Material.ActionButton"> </style> 

on the console:

home / user / workspace / appcompat_v7 / res / values-v21 / themes_base.xml: 156: error: Error: The resource was not found that matches the specified name: attr 'android: colorControlNormal'.

and a few similar errors that change only "android: *"

How can i fix this?

+5
source share
4 answers

Well, I'm not sure if this is a real "solution", but here is my theory and what I did:

My theory

After updating the version of "Android Support Library" version 21, I received a similar error. It seems that my IntelliJ did not update the resources in my module correctly by pointing to the ressources directory for appcompat.

In addition, I had some widgets and code that directly pointed to drawings in these resources.

But in v21, the Android support library, Google turned off Holo ! Theme support

Therefore, the compiler complains that it will not find the resources on which my topic depends.

What I've done

When it is compiled

Honestly, I'm not quite sure how I got to this job. I think I used reloading and flushing the cache, etc. Copying resources to my project folder, etc. When my application finally started, it looked different! Of course, he had a Material Theme instead of a Holo.

And not everyone survived this transition. For instance. the action bar was black (standard) and not green (my theme). So I tried to revert to the old version of appcompat instead of porting my entire application to Material.

Since you asked me about my decision, I am posting what I did to “downgrade” to appomppat v20.

Upgrade to appcompat v20

  • Launch SDK Manager
  • Download Android Support Repository
  • Go to the directory \ android-sdk \ extras \ android \ m2repository \ com \ android \ support \ appcompat-v7 \ 20.0.0 \ where the Android SDK is installed
  • Extract all the files from appcompat-v7-20.0.0.aar (this is a zip file) to the libs\appcompat\ in my project after creating the appcompat directory
  • Added this as a module in my IntelliJ and made my project depend on this module
  • Restored android-support-v7-appcompat.jar for v20 from my git repository
  • Used a restored jar of appcompat instead of v21 one

Step 6 is one that is very difficult for me. I expected the classes.jar from the .aar file to be android-support-v7-appcompat.jar , but that is not the case. I don’t even know where you can get android-support-v7-appcompat.jar from the correct version, because I did not find it in the repository. And I did not want to download it from "somewhere on the Internet."

I was lucky it was already in my git in the correct version.

Now my application is compiled and looks right. Hope is so yours!

+4
source

There was the same problem after updating my Eclipse and importing the "Android Support Library" in the workspace.

I think this is a bad solution for "Downgrading to appcompat", so I tried to find another way and found it. My problem was that my “Project Build Target” for AppCompat was installed in the lvl 19 API. So this is the problem:

-Eclipse did not load data for the lvl 21 API for AppCompat.

-Appcompat have Target API lvl 19, but trying to set the style for API lvl 21.

Maybe you have the same problem, so check out what helped me:

1.

Right-click on the project Appcompat => Properties => Android => Checkout, where your sign was, and if it is not installed on Android 5.0, correct it and click "OK."

2.

Project => Clean => Set "Clear All Projects" => Ok

PS Sorry if I have errors - English is not my native language.

+4
source

home / user / workspace / appcompat_v7 / res / values-v21 / themes_base.xml: 156: error: Error: The resource was not found that matches the specified name: attr 'android: colorControlNormal'.

I assumed that values-v21 means api level 21, so I updated android 5.0 and it works for me.

+3
source

My solution is more radical: delete all style files and every link for them

+1
source

Source: https://habr.com/ru/post/1205037/


All Articles