6

Я пытаюсь интегрировать ActionBarCompat в один из моих проектов. Я использую систему сборки Gradle.Переключение на ActionBarCompat, но есть ошибки, связанные с построением темы

Я добавил зависимость как:

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

Я не использую свой стиль, у меня есть тема, заявленная в моем AndroidManifest.xml как:

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

Дело в том, что это в проекте библиотеки Android. Это очень хорошо работает с ActionBarSherlock. Но теперь я получаю следующие ошибки.

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'. 

В чем проблема? Может ли кто-нибудь предложить решение?

+0

Вставить в полный 'build.gradle'. –

ответ

11

Я, наконец, нашел проблему! Похоже, у меня был избыточное заявление в моем attrs.xml файла:

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

Я не знаю, почему в ад я бы заявил, что. Возможно, какой-то код для копирования. Но это был корень проблемы.

У меня есть ActionBarCompat, теперь работающий отлично. Кстати, ActionBarSherlock отлично справился с вышеуказанным заявлением.

+2

Мы не должны благодарить вас, но .. СПАСИБО. 5 часов по этой проблеме. – VonSchnauzer

+0

У меня также была эта проблема часами, вы спасли мой день. Я удалил все «<объявить-styleable name =« Theme »>», и теперь это работает штрафы. благодаря – LucasFM