android-support-v7-appcompat has same attrs as act

2019-07-28 19:27发布

问题:

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