android-support-v7-appcompat has same attrs as actionbarsherlock library

空扰寡人 提交于 2019-12-11 13:57:12

问题


I'm trying to get chromecast integration in my app but I'm having build issues when I add the android-support-v7-appcompat to my project. Basically it has an attrs.xml file that has the same values as the actionbarsherlock attrs.xml file. Is there anyway around this? This seems kind of ridiculous that different libraries can possibly conflict resource values.


回答1:


I just encounter the same problem and had a hard time for several hours figuring this out. this is how I solved it.

You usually need support-v7-appcompat if your minimum sdk supported is below API14.

  1. I removed support-v7-appcompat as my library. (This will show error regarding missing theme.)

  2. For all the styles.xml in all folders (mine are) values, values-v11 and values-v14

    style name="AppBaseTheme" parent="Theme.AppCompat.Light"

    replace it with

    style name="AppBaseTheme" parent="android:Theme.Light"

  3. for some reason, in my menu xml file. it had error for android:showAsAction. I was able to solve it by deleting it then save and then copying the same thing from another file i have because I want that function. (Really weird it was just the same text.)

  4. I did my sherlock code adjustments needed for my app

I am now able to run actionbar in 2.3.3



来源:https://stackoverflow.com/questions/17903101/android-support-v7-appcompat-has-same-attrs-as-actionbarsherlock-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!