Transition to ActionBarCompat but related build errors

I am trying to integrate ActionBarCompat into one of my projects. I am using Gradle build system.

I added a dependency like:

dependencies { compile 'com.android.support:appcompat-v7:18.0.+' } 

I do not use custom style, I have a theme installed in my AndroidManifest.xml as:

  <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/Theme.AppCompat" > 

The fact is that this is in the Android library project. This works very well with ActionBarSherlock. But now I get the following errors.

 LibraryProject/build/res/all/release/values/values.xml:764: error: Error: No resource found that matches the given name: attr 'dropdownListPreferredItemHeight'. LibraryProject/build/res/all/release/values/values.xml:768: error: Error: No resource found that matches the given name: attr 'popupMenuStyle'. LibraryProject/build/res/all/release/values/values.xml:813: error: Error: No resource found that matches the given name: attr 'dropdownListPreferredItemHeight'. LibraryProject/build/res/all/release/values/values.xml:817: error: Error: No resource found that matches the given name: attr 'popupMenuStyle'. LibraryProject/build/res/all/release/values/values.xml:848: error: Error: No resource found that matches the given name: attr 'dropdownListPreferredItemHeight'. LibraryProject/build/res/all/release/values/values.xml:852: error: Error: No resource found that matches the given name: attr 'popupMenuStyle'. LibraryProject/build/res/all/release/values/values.xml:912: error: Error: No resource found that matches the given name: attr 'actionDropDownStyle'. LibraryProject/build/res/all/release/values/values.xml:925: error: Error: No resource found that matches the given name: attr 'listChoiceBackgroundIndicator'. LibraryProject/build/res/all/release/values/values.xml:923: error: Error: No resource found that matches the given name: attr 'panelMenuListTheme'. LibraryProject/build/res/all/release/values/values.xml:922: error: Error: No resource found that matches the given name: attr 'panelMenuListWidth'. LibraryProject/build/res/all/release/values/values.xml:969: error: Error: No resource found that matches the given name: attr 'actionDropDownStyle'. LibraryProject/build/res/all/release/values/values.xml:975: error: Error: No resource found that matches the given name: attr 'listChoiceBackgroundIndicator'. LibraryProject/build/res/all/release/values/values.xml:973: error: Error: No resource found that matches the given name: attr 'panelMenuListTheme'. LibraryProject/build/res/all/release/values/values.xml:972: error: Error: No resource found that matches the given name: attr 'panelMenuListWidth'. LibraryProject/build/res/all/release/values/values.xml:998: error: Error: No resource found that matches the given name: attr 'actionDropDownStyle'. LibraryProject/build/res/all/release/values/values.xml:1002: error: Error: No resource found that matches the given name: attr 'listChoiceBackgroundIndicator'. 

What could be the problem? Can anyone suggest a solution?

+6
source share
1 answer

I finally found a problem! It looks like I had a redundant declaration in the attrs.xml file:

  <declare-styleable name="Theme"> </declare-styleable> 

I donโ€™t know why in hell I would say that. Maybe some kind of code to copy. But that was the root of the problem.

Now ActionBarCompat works fine for me. By the way, ActionBarSherlock did a great job with the above expression.

+11
source

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


All Articles