好了,我知道这个问题已经被问了很多。而且,我也有试过张贴在SO几种方法。但是,没有一个似乎为我工作。
所以,这里是我如何做到这一点。我在我的摇篮文件中添加这行code里面的依赖关系:
编译com.actionbarsherlock:actionbarsherlock:4.4.0@aar
但后来当我尝试同步我的项目摇篮,它给了我这些错误:
摇篮调用成功地与75误差30秒(S)已完成
这些都是错误的:
D:RandomProjectsSwipeExperimentSwipeExperimentbuildexploded-aarcom.android.supportappcompat-v719.1.0resvaluesvalues.xml 错误:属性titleTextStyle已经被定义 错误:属性subtitleTextStyle已经被定义 错误:属性除法已经被定义 错误:属性背景已经被定义 错误:属性backgroundSplit已经被定义 错误:属性actionDropDownStyle已经被定义 错误:属性DROPDOWNLIST preferredItemHeight已经被定义 错误:属性popupMenuStyle已经被定义 D:RandomProjectsSwipeExperimentSwipeExperimentbuildexploded-aarcom.actionbarsherlockactionbarsherlock4.4.0resvaluesvalues.xml 错误:属性navigationMode已经被定义 错误:属性displayOptions已经被定义 错误:属性标题已经被定义 错误:属性字幕已经被定义 错误:属性图标,已经被定义 错误:属性标识已经被定义 错误:属性backgroundStacked已经被定义 。 。 。 错误:属性windowActionBarOverlay已经被定义 错误:属性windowSplitActionBar已经被定义 错误:属性listPopupWindowStyle已经被定义 错误:属性activityChooserViewStyle已经被定义解决方案
您的项目依赖于两个 appcompat-V7
和 ActionBarSherlock
。他们都提供相同的功能和定义相同的样式属性 - 这是相互矛盾的。
请删除 ActionBarShelock
或 appcompat-V7
库。
我推荐使用动作条
从 appcompat-V7
,而不是 ActionBarSherlock
。
支持库特征。 AppCompat
添加操作栏
Okay, i know this question have been asked a lot.. And, i also have tried several methods posted in SO. But none seems to work for me.
So, here's how i do it. I add this line of code inside dependencies in my gradle files:
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
But then when i try to sync my project with gradle, it gives me these error:
Gradle invocation completed successfully with 75 error(s) in 30 sec
These are the errors:
D:RandomProjectsSwipeExperimentSwipeExperimentbuildexploded-aarcom.android.supportappcompat-v719.1.0resvaluesvalues.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:RandomProjectsSwipeExperimentSwipeExperimentbuildexploded-aarcom.actionbarsherlockactionbarsherlock4.4.0resvaluesvalues.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
解决方案
Your project depends on both appcompat-v7
and ActionBarSherlock
. They both provide the same functionality and define the same style attributes - which are conflicting.
Either remove ActionBarShelock
or appcompat-v7
library.
I recommend using ActionBar
from appcompat-v7
rather than ActionBarSherlock
.
Support library features. AppCompat
Adding the Action Bar
相关推荐
最新文章