Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
389 views
in Technique[技术] by (71.8m points)

actionbarsherlock - Error after adding dependencies to Action Bar Sherlock in Android Studio 0.5.8

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:RandomProjectsSwipeExperimentSwipeExperimentuildexploded-aarcom.android.supportappcompat-v719.1.0
esvaluesvalues.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:RandomProjectsSwipeExperimentSwipeExperimentuildexploded-aarcom.actionbarsherlockactionbarsherlock4.4.0
esvaluesvalues.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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...