Question

Je fais une nouvelle application Android, et je suis en utilisant la bibliothèque barre de sherlock d'action.

J'ai importé la bibliothèque comme un projet et a deux erreurs. Tout d'abord, toutes mes mises en page ne se trouvent pas dans le fichier gen.R, parce que je n'ai pas de fichier gen.R. « R ne peut pas être résolu à une variable »

En second lieu, je l'ai lu dans certains forums que Effacez et régénérez aide peut, mais cela n'a pas résolu mon problème. Après un nettoyage, je suis arrivé cette erreur:

[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:47: error: Error: No resource found that matches the given name: attr 'android:actionBarSize'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:48: error: Error: No resource found that matches the given name: attr 'android:actionBarStyle'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:50: error: Error: No resource found that matches the given name: attr 'android:actionBarTabBarStyle'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:49: error: Error: No resource found that matches the given name: attr 'android:actionBarTabStyle'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:51: error: Error: No resource found that matches the given name: attr 'android:actionBarTabTextStyle'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:52: error: Error: No resource found that matches the given name: attr 'android:actionButtonStyle'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:53: error: Error: No resource found that matches the given name: attr 'android:actionDropDownStyle'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:54: error: Error: No resource found that matches the given name: attr 'android:actionMenuTextAppearance'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:55: error: Error: No resource found that matches the given name: attr 'android:actionMenuTextColor'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:56: error: Error: No resource found that matches the given name: attr 'android:actionModeBackground'.
[2011-11-29 12:17:08 - DroidFridge] C:\Users\Felix Wackernagel\Downloads\JakeWharton-ActionBarSherlock-79a1bbc\library\res\values-v11\abs__styles.xml:57: error: Error: No resource found that matches the given name: attr 'android:actionModeCloseButtonStyle'.

...

XML-Files provient de la bibliothèque ActionBarSherlock. La bibliothèque comme projet n'a pas montré une erreur.

Aide Quelqu'un peut-il me?

Était-ce utile?

La solution 2

Le problème n'a pas été la version Android était la version Java. La plupart de la bibliothèque Android et aussi Android aussi, ne peut pas gérer Java 1.7. Je change mes propriétés du projet et construire mon projet sous Java 1.6 et il fonctionne. Même problème par HoloEverywhere.

Autres conseils

Assurez-vous que votre projet et l'utilisation de la bibliothèque importée de la même version Android.

Ceci est souvent lié à la version Android utilise votre projet, en particulier si vous importez quelque chose qui est une version différente de celle de votre projet.

Pour une procédure pas à pas pour résoudre le problème, voir ma réponse

S'il vous plaît noter que pour compiler un projet androïde avec succès et de le faire tourner sur la version plus ancienne d'Android est (la plupart du temps) une autre chose.

pour votre réponse, Android: Theme.Holo est Android Honeycomb et le thème ci-dessus. Alors ActionBarSherlock et votre projet doit être compilé avec le niveau de l'API (minimum) 11 (Android 3.0). D'habitude, je prends juste ICS (14 +)

pour le faire tourner sur la version d'Android plus: ouvrez votre projet fichier manifeste, changer la ligne:

<uses-sdk android:targetSdkVersion="14"/>

à

<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="14"/>

Votre application Android peut fonctionner à partir du niveau de l'API 7 (2.2) au niveau de l'API 14 (4.0). Vous pouvez tester en l'exécutant avec l'émulateur 2.2.

Notez que ActionBarSherlock ne fonctionne pas avec le niveau d'API inférieur à 7.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top