2012-02-25 28 views
31

Jeśli używam ActionBarSherlock 3.5.1, wszystko jest w porządku i działa. Ale jeśli chcę używać 4.0 RC1, mam błędy.
ActionBarSherlock 4.0 nie działa. Ale 3.5.1 do

[2012-02-25 10:08:19 - SherlockApp] /home/leandros/workspace/ActionBarSherlock40/res/values-v14/abs__styles.xml:6: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.Solid'. 
[2012-02-25 10:08:19 - SherlockApp] /home/leandros/workspace/ActionBarSherlock40/res/values-v14/abs__styles.xml:10: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.Solid'. 
[2012-02-25 10:08:19 - SherlockApp] /home/leandros/workspace/ActionBarSherlock40/res/values-v14/abs__styles.xml:12: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.Solid.Inverse'. 
[2012-02-25 10:08:19 - SherlockApp] /home/leandros/workspace/ActionBarSherlock40/res/values-v14/abs__styles.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabView.Inverse'. 
[2012-02-25 10:08:19 - SherlockApp] /home/leandros/workspace/ActionBarSherlock40/res/values-v14/abs__styles.xml:26: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabBar.Inverse'. 
[2012-02-25 10:08:19 - SherlockApp] /home/leandros/workspace/ActionBarSherlock40/res/values/abs__styles.xml:101: error: Error: No resource found that matches the given name: attr 'android:textAllCaps'. 
[2012-02-25 10:08:19 - SherlockApp] /home/leandros/workspace/ActionBarSherlock40/res/values-v14/abs__styles.xml:33: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabText.Inverse'. 
[2012-02-25 10:08:19 - SherlockApp] /home/leandros/workspace/ActionBarSherlock40/res/values-v14/abs__styles.xml:55: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionMode.Inverse'. 
[2012-02-25 10:08:19 - SherlockApp] /home/leandros/workspace/ActionBarSherlock40/res/values/abs__styles.xml:244: error: Error: No resource found that matches the given name: attr 'android:textAllCaps'. 
[2012-02-25 10:08:19 - SherlockApp] /home/leandros/workspace/ActionBarSherlock40/res/values-v14/abs__styles.xml:88: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Menu'. 
[2012-02-25 10:08:19 - SherlockApp] /home/leandros/workspace/ActionBarSherlock40/res/values-v14/abs__styles.xml:93: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Title.Inverse'. 
[2012-02-25 10:08:19 - SherlockApp] /home/leandros/workspace/ActionBarSherlock40/res/values-v14/abs__styles.xml:97: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Subtitle.Inverse'. 
[2012-02-25 10:08:19 - SherlockApp] /home/leandros/workspace/ActionBarSherlock40/res/values-v14/abs__styles.xml:101: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Title.Inverse'. 
[2012-02-25 10:08:19 - SherlockApp] /home/leandros/workspace/ActionBarSherlock40/res/values-v14/abs__styles.xml:105: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Subtitle.Inverse'. 
[2012-02-25 10:08:19 - SherlockApp] /home/leandros/workspace/ActionBarSherlock40/res/values-v14/abs__themes.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'. 

Jakieś pomysły?

Odpowiedz

56

Pamiętaj, aby ustawić poziom docelowy API (zarówno projektu ActionBarSherlock i waszą) do 15. W tym celu:

  1. Zmień android: targetSdkVersion do "15" w obu plikach AndroidManifest.xml.
  2. Zmień cel kompilacji na "Android 4.0.3" (lub równoważny interfejs API innej firmy), używając Właściwości projektu (prawdopodobnie także zarówno ActionBarSherlock, jak i projektu).

Nie znalazłem żadnej dokumentacji dotyczącej tej zmiany, ale dowiedziałem się o niej po błędzie "n".

+0

Rozwiązanie jest poprawne. Solvev na własną rękę wczoraj. Ale i tak dzięki. Ale nie mogę odpowiedzieć na moje własne pytanie :) – Leandros

+1

również jeśli korzystasz z IntelliJ IDEA, ustaw SDK modułów na 4.0.3+ dla tego samego efektu :) – Dori

+0

Otrzymuję to po wykonaniu Twoich kroków: E/AndroidRuntime (1508): Spowodowane przez: java.lang.ClassNotFoundException: xxxx.XXXXActivity w programie ładującym dalvik.system.PathClassLoader [/mnt/asec/xxx.xxx-2/pkg.apk] –

5

Ustawianie Java zgodność poziomu (projekt> Właściwości), aby 1,6 (zamiast 1,5) nie praca dla mnie.

Zmiana poziomu interfejsu API nie działa!

0

Jeśli używasz tego samego

android: minSdkVersion = "?" android: targetSdkVersion = "?"

Wartości obu projektów i projektu biblioteki powinny zostać rozwiązane. Po tym nie zapomnij zmienić android.target =? (MAX VALUE) w pliku project.properties.

1

prawym przyciskiem myszy na bibliotekę -> Właściwości -> Android -> Ustaw cel budowania projektu do najnowszej

wykonaj to samo dla swojego projektu.

Teraz wyczyść bibliotekę i projekt, to powinno rozwiązać problem.

Powiązane problemy