Compilation errors using ActionbarSherlock in android studio 0.3.1

I just created a new project with android studio, and according to the usage documentation for ActionbarSherlock added two lines to my build.gradle.

My build.gradle looks like this:

buildscript {
 repositories {
        mavenCentral()
 }
 dependencies {
        classpath 'com.android.tools.build:gradle:0.6.+'
 }
}
apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 18
    buildToolsVersion "18.1.1"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 18
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:+'
    compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
    compile 'com.android.support:support-v4:18.0.+'
}

When I try to compile, I get the following errors:

Compilation completed with 75 errors and 0 warnings in 14 sec
/Users/anthony/android/TestProject/Testqirc/build/exploded-
bundles/ComAndroidSupportAppcompatV71800.aar/res/values/values.xml
Gradle: Attribute "titleTextStyle" has already been defined
....
....
Gradle: Attribute "activityChooserViewStyle" has already been defined

change dependenciesto

   dependencies {
    compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
    compile 'com.android.support:support-v4:18.0.+'
   }

I get this error:

Gradle: Error getting the parent element for the element: the resource was not found matches the specified name "Theme.AppCompat.Light.DarkActionBar".

+4
source share
5 answers

. Android 2.0: Actionbar ( appcompat v7 ): @style/Theme.AppCompat.Light.DarkActionBar

ActionBarSherlock AppCompat ; . , , AppCompat, , . DarkActionBar src/main/res/layout/fragment_main.xml.

+3

:

compile 'com.android.support:support-v4:18.0.+'

0

, Theme.AppCompat.Light.DarkActionBar , styles.xml.

.xml :

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.Sherlock.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    </style>

</resources>

build.gradle:

dependencies {
    compile 'com.android.support:support-v4:19.1.0'
    compile "com.actionbarsherlock:actionbarsherlock:4.4.0@aar"
}
0

( ), Ultimate Stopwatch Studio. ( ), Studio ( ), , , Youtube ( ).

- - build.gradle ActionBarSherlock:

dependencies {
    compile 'com.android.support:appcompat-v7:20.+'
    compile 'com.android.support:support-v4:20.+'
}

It turned out that the V7 support code already has a copy of ActionBarSherlock, so you get duplicates. This worked for me - just pull out V7 support:

dependencies {
    compile 'com.android.support:support-v4:20.+'
}

And here is a link to the procedure for adding a library to Studio:

Youtube: how to add libraries to Android Studio from Mohammed Isa

https://www.youtube.com/watch?v=1MyBO9z7ojk

Cheers, Jim A

0
source

just upgrade to the latest version of game services and appcompat

fooobar.com/questions/250934 / ...

0
source

All Articles