1

我在使用this教程來製作和應用2.3.x設備的操作欄。但我無法導入程序兼容性-V7我projecto ......它給了我很多的錯誤這樣的:Appcompat v7和ActionBarActivity

[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-v21\themes_base.xml:194: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'. 
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-v21\themes_base.xml:195: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'. 
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-v21\themes_base.xml:193: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'. 
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-v21\themes_base.xml:190: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'. 
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-v21\themes_base.xml:191: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'. 
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-large-v14\themes_base.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Base.AppCompat.DialogWhenLarge.Base'. 
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-large-v14\themes_base.xml:22: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Base.AppCompat.Light.DialogWhenLarge.Base'. 

,所以我不能導入我的應用程序的主題,我的操作欄不顯示...

+0

也許[這將有助於(點擊)](http://stackoverflow.com/questions/26431676/appcompat-v721-0-0-no-resource-found-that-matches-the-given-name-attr -andro/26449172#26449172) – reVerse 2014-11-06 17:29:14

+0

已經做到了......明顯......現在我的項目不再運行了...... – 2014-11-06 17:36:14

回答

0

在您的項目和android-support-v7-appcompat(在res下)的project.properties中,註釋掉目標API(如果不是target=android-21),並將新的目標代碼放在那裏。

如果這不起作用,或者您無法使用21+ API,請確保您的應用程序的project.propertiesandroid.library=false

接下來檢查您的項目的Referenced Libraries在構建路徑中不包含v4。我相信我正確地說,v7-appcompat需要它(以前的版本),但它包含在android-support-v7-appcompat文件中,因此重複條目會導致問題。

1

在您的項目的project.properties中android-support-v7-appcompat請確保目標值如下。 項目目標。

target=android-21 
android.library=true 

完成後清理項目。我希望這可以工作。

0

我也有這個問題。我發現許多解決方案必須更新到Android 5.0 API級別21 ..您可以看到更新所有IDE的解決方案之一。 HERE

..

(注:以下方法對我來說是我的第二個辦法解決方案。)

如果你不想更新,你可以嘗試在現有的API level..I找到解決方案我的方法是,當你創建新的Android應用程序的項目,選擇如下

minSdkVersion= API 14 , targetSdkVersion=API 17 , compiled with=API 17

希望,這將幫助!

相關問題