6

Sto cercando di integrare ActionBarCompat in uno dei miei progetti. Io uso il sistema di build Gradle.Passaggio a ActionBarCompat, ma errori di compilazione relativi ai temi

Ho aggiunto la dipendenza come:

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

Non faccio uso di uno stile personalizzato, ho il tema impostato nel mio AndroidManifest.xml come:

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

Il fatto è che questo è in un progetto di libreria Android. Sta funzionando abbastanza bene con ActionBarSherlock. Ma ora ho i seguenti errori.

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

Quale può essere il problema? Qualcuno può suggerire una soluzione?

+0

Incolla in completo 'build.gradle'. –

risposta

11

Ho finalmente trovato il problema! Sembra come se avessi una dichiarazione ridondante nel mio attrs.xml di file:

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

Non so perché diavolo avrei dichiarato che. Probabilmente un po 'di copia incolla il codice. Ma quella era la radice del problema.

Ho ActionBarCompat ora funziona perfettamente. A proposito, ActionBarSherlock ha funzionato perfettamente con la dichiarazione di cui sopra.

+2

Non dovremmo dire grazie ma .. GRAZIE. 5 ore su questo problema. – VonSchnauzer

+0

Ho anche avuto questo problema per ore, mi hai salvato la giornata. Ho rimosso tutto il "" e ora è in vigore una multa. Grazie – LucasFM

Problemi correlati