Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Switching to ActionBarCompat, but have theme related build errors

I'm trying to integrate ActionBarCompat to one of my projects. I use the Gradle build system.

I have added the dependency as:

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

I don't use a custom style, I have the theme set in my AndroidManifest.xml as:

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

The thing is that this is in an Android library project. It was working pretty good 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 can be the problem? Can anybody suggest a solution?

like image 989
Ertan D. Avatar asked Aug 18 '13 13:08

Ertan D.


1 Answers

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

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

I don't know why in hell I would have declared that. Probably some copy paste code. But that was the root of the problem.

I have ActionBarCompat now working perfectly. By the way, ActionBarSherlock worked perfectly with the above declaration.

like image 194
Ertan D. Avatar answered Sep 19 '22 20:09

Ertan D.