好的,我知道这个问题已经问了很多。而且,我还尝试了SO中发布的几种方法。但是似乎没有一个对我有用。
所以,这就是我的做法。我将这行代码添加到我的gradle文件中的依赖项中:
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
但是,当我尝试将我的项目与gradle同步时,它给了我这些错误:
Gradle invocation completed successfully with 75 error(s) in 30 sec
这些是错误:
D:\RandomProjects\SwipeExperiment\SwipeExperiment\build\exploded-aar\com.android.support\appcompat-v7\19.1.0\res\values\values.xml
Error:Attribute "titleTextStyle" has already been defined
Error:Attribute "subtitleTextStyle" has already been defined
Error:Attribute "divider" has already been defined
Error:Attribute "background" has already been defined
Error:Attribute "backgroundSplit" has already been defined
Error:Attribute "actionDropDownStyle" has already been defined
Error:Attribute "dropdownListPreferredItemHeight" has already been defined
Error:Attribute "popupMenuStyle" has already been defined
D:\RandomProjects\SwipeExperiment\SwipeExperiment\build\exploded-aar\com.actionbarsherlock\actionbarsherlock\4.4.0\res\values\values.xml
Error:Attribute "navigationMode" has already been defined
Error:Attribute "displayOptions" has already been defined
Error:Attribute "title" has already been defined
Error:Attribute "subtitle" has already been defined
Error:Attribute "icon" has already been defined
Error:Attribute "logo" has already been defined
Error:Attribute "backgroundStacked" has already been defined
.
.
.
Error:Attribute "windowActionBarOverlay" has already been defined
Error:Attribute "windowSplitActionBar" has already been defined
Error:Attribute "listPopupWindowStyle" has already been defined
Error:Attribute "activityChooserViewStyle" has already been defined
您的项目取决于appcompat-v7
和ActionBarSherlock
。它们都提供相同的功能并定义相同的样式属性-这是相互冲突的。
删除ActionBarShelock
或存储appcompat-v7
。
我建议使用ActionBar
fromappcompat-v7
而不是ActionBarSherlock
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句