appcompat_v7 与 actionbarsherlock 冲突解决/移除项目中的appcompat_v7

来源:互联网 发布:浙江师范行知学院宿舍 编辑:程序博客网 时间:2024/05/20 11:22


当项目使用slidingmenu的时候需要引入actionbarSherlock的library,就会 报如下错误


0000known] F:\myworkspace\appcompat_v7\res\values\attrs.xml:32: error: Attribute "windowActionBar" has already been defined
[2014-11-23 05:12:55 - my10000known] F:\myworkspace\appcompat_v7\res\values\attrs.xml:33: error: Attribute "windowActionBarOverlay" has already been defined
[2014-11-23 05:12:55 - my10000known] F:\myworkspace\appcompat_v7\res\values\attrs.xml:34: error: Attribute "windowSplitActionBar" has already been defined
[2014-11-23 05:12:55 - my10000known] F:\myworkspace\appcompat_v7\res\values\attrs.xml:64: error: Attribute "actionBarTabStyle" has already been defined
[2014-11-23 05:12:55 - my10000known] F:\myworkspace\appcompat_v7\res\values\attrs.xml:65: error: Attribute "actionBarTabBarStyle" has already been defined
[2014-11-23 05:12:55 - my10000known] F:\myworkspace\appcompat_v7\res\values\attrs.xml:66: error: Attribute "actionBarTabTextStyle" has already been defined
[2014-11-23 05:12:55 - my10000known] F:\myworkspace\appcompat_v7\res\values\attrs.xml:67: error: Attribute "actionOverflowButtonStyle" has already been defined
[2014-11-23 05:12:55 - my10000known] F:\myworkspace\appcompat_v7\res\values\attrs.xml:69: error: Attribute "actionBarStyle" has already been defined
[2014-11-23 05:12:55 - my10000known] F:\myworkspace\appcompat_v7\res\values\attrs.xml:77: error: Attribute "actionBarSplitStyle" has already been defined
[2014-11-23 05:12:55 - my10000known] F:\myworkspace\appcompat_v7\res\values\attrs.xml:85: error: Attribute "actionBarWidgetTheme" has already been defined
[2014-11-23 05:12:55 - my10000known] F:\myworkspace\appcompat_v7\res\values\attrs.xml:88: error: Attribute "actionBarSize" has already been defined


试了很多种方法无法兼容,决定删除appcompat_v7 兼容包,具体方法如下:


第一步:移除引用的appcompat_v7  library ,操作    properties ->android选项 ->选择appcompat_v7 

第二步:修改AndroidManifest文件:配置android:minSdkVersion 为14或以上版本,配置 android:theme="@style/AppBaseTheme"或以上版本

第三步:修改res文件中,menu文件夹下main.xml文件,,修改app:showAsAction="never"为

android:showAsAction="never",clean下项目就行了。

然后项目就可以顺利使用slidingmenu了。




0 0