首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >向Android Studio 0.5.8中的Action Bar Sherlock添加依赖项后出错

向Android Studio 0.5.8中的Action Bar Sherlock添加依赖项后出错
EN

Stack Overflow用户
提问于 2014-05-19 16:26:49
回答 1查看 11.5K关注 0票数 17

好吧,我知道这个问题已经被问了很多次了..而且,我还尝试了几种在SO中发布的方法。但似乎没有一个对我有效。

所以,我是这样做的。我在gradle文件的依赖项中添加了下面这行代码:

代码语言:javascript
复制
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'

但是,当我尝试将我的项目与gradle同步时,它给出了以下错误:

代码语言:javascript
复制
Gradle invocation completed successfully with 75 error(s) in 30 sec

以下是错误:

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-05-19 16:35:53

您的项目依赖于appcompat-v7ActionBarSherlock。它们都提供了相同的功能并定义了相同的样式属性--这是相互冲突的。

删除ActionBarShelockappcompat-v7库。

我推荐使用appcompat-v7ActionBar,而不是ActionBarSherlock

Support library features. AppCompat

Adding the Action Bar

票数 48
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23733021

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档