Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:\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
like image 625
Milanor Avatar asked May 19 '14 08:05

Milanor


1 Answers

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

like image 97
Yaroslav Mytkalyk Avatar answered Sep 20 '22 18:09

Yaroslav Mytkalyk