2014-04-05 17 views
6

Poniżej znajduje się plik styles.xml dla android-support-v7-mediarouter.Błąd w pliku styles.xml w android-support-v7-mediarouter

<resources> 
    <style name="Widget.MediaRouter.MediaRouteButton" 
      parent="Widget.AppCompat.ActionButton"> 
     <item name="android:minWidth">56dp</item> 
     <item name="android:minHeight">48dp</item> 
     <item name="android:padding">0dp</item> 
     <item name="android:focusable">true</item> 
     <item name="android:contentDescription">@string/mr_media_route_button_content_description</item> 
     <item name="externalRouteEnabledDrawable">@drawable/mr_ic_media_route_holo_dark</item> 
    </style> 

    <style name="Widget.MediaRouter.Light.MediaRouteButton" 
      parent="Widget.AppCompat.Light.ActionButton"> 
     <item name="android:minWidth">56dp</item> 
     <item name="android:minHeight">48dp</item> 
     <item name="android:padding">0dp</item> 
     <item name="android:focusable">true</item> 
     <item name="android:contentDescription">@string/mr_media_route_button_content_description</item> 
     <item name="externalRouteEnabledDrawable">@drawable/mr_ic_media_route_holo_light</item> 
    </style> 
</resources> 

Ale ja dostaję mnóstwo żadnym zasobem znaleziono błędy, niektóre z nich to:

[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:24: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:28: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:32: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.Solid'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:36: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.Solid'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:40: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.Solid.Inverse'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:122: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionButton'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:125: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionButton'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:129: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionButton.CloseMode'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:133: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionButton.CloseMode'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:137: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionButton.Overflow'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:141: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionButton.Overflow'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:44: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.TabBar'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:48: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabBar'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:52: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabBar.Inverse'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:56: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.TabView'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:60: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabView'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:64: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabView.Inverse'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:68: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.TabText'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:72: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabText'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:76: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabText.Inverse'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:80: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionMode.Inverse'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:104: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Title'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:108: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Subtitle'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:112: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Title.Inverse'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:116: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Subtitle.Inverse'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:84: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Menu'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:88: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Title'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:92: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Subtitle'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:96: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Title.Inverse'. 
[2014-04-05 10:03:14 - SplashActivity] /home/sahil/workspace/android-support-v7-appcompat/res/values-v14/styles_base.xml:100: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Subtitle.Inverse'. 

Próbuję dostać QuickBlox chat sample to work. ** EDIT: ** Wersje: enter image description here enter image description here enter image description here

+0

Czy umieściłeś bibliotekę 'mediarouter' w swoim projekcie Android? Biblioteka znajduje się tutaj, zakładając, że masz już zainstalowany zestaw SDK Androida: '.. \ android-sdk \ dodatki \ android \ wsparcie \ v7 \ mediarouter' – ChuongPham

+0

@ChuongPham Tak zrobiłem to przez projekt-> właściwości-> źródło-> link source-> path to mediarouter .. Ale dostałem wszystkie te błędy .. –

+0

Sprawdź moją odpowiedź poniżej, aby zobaczyć, czy to pomaga. Uwaga: Być może będziesz musiał usunąć swoje bieżące odniesienie do biblioteki 'mediarouter'. – ChuongPham

Odpowiedz

3

W Eclipse, aby udostępnić bibliotekę mediarouter w wielu projektach z Androidem, wykonaj następujące czynności:

  1. w Eclipse, wybierz Plik | Importuj Istniejące projekty w obszarze roboczym. kliknij Następny.

  2. Kliknij Przeglądaj i przejdź do katalogu katalogu appcompat Androida. Domyślny katalog powinien być: ..\android-sdk\extras\android\support\v7\mediarouter\.

  3. Kliknij przycisk Zakończ, aby dodać nowy projekt.

  4. Wybierz zakładkę Właściwości projektu Android.

  5. W Properties ekranie wybierz opcję Android (w lewym panelu), a następnie kliknij Dodaj i wybierz mediarouter bibliotekę z listy.

  6. Kliknij przycisk OK, aby zapisać zmiany.

WAŻNE: Powtórz powyższe czynności, aby dodać biblioteki appcompat i gridlayout na Androida projektów biblioteki te są wymagane przez bibliotekę mediarouter. Po dodaniu bibliotek appcompat i gridlayout do przestrzeni roboczej dodaj biblioteki appcompat i gridlayout do projektu mediarouter, wykonując kroki od 4 do 6 powyżej i zastępując nazwę appcompat/gridlayout tam, gdzie jest to wymagane.

Zważywszy na osadzić bibliotekę w każdym projekcie Android mediarouter, wystarczy skopiować pliki JAR z libs folderze mediarouter jest w libs folderze twojego projektu. Należy również skopiować biblioteki z folderów appcompat i gridlayout do folderu projektu także w folderze libs!

+1

+1 :) To pomogło naprawić wiele błędów importu w plikach .java, ale plik styles.xml nadal pokazuje te same błędy. Błąd : Błąd pobierania elementu nadrzędnego dla elementu: Nie znaleziono zasobu pasującego do podanej nazwy 'Theme.AppCompat .Light.DarkActionBar ". \t styles.xml \t/SplashActivity/res/wartości \t linia 4 \t Android AAPT Problem –

+0

BDW umieszczam je wszystkie w folderze Moje projekty lib. –

+0

Czy próbowałeś udostępnionej opcji zamiast opcji osadzania? Uwaga: Opcja współużytkowana obejmuje również zasoby (styles.xml), więc rozwiąże to napotkany problem. – ChuongPham

7

Android media router zależy od biblioteki appcompat v7. aby prawidłowo rozwiązać ten problem, należy dodać AppCompat jako zależność dla „android-support-V7-mediarouter” projekt biblioteki, a następnie dodać mediarouter jako zależność dla własnego projektu ...

raczej projektu zależy android-support-v7 mediarouter która zależy od appcompat_v7

stare pytanie, późną odpowiedź, ale mam nadzieję, że ktoś pomoże. Zajęło mi trochę czasu, aby to rozgryźć.

:)

Powiązane problemy