Search code examples
androidactionbarsherlockgradleandroid-studioslidingmenu

Gradle Error: Android Studio, ActionbarSherlock, and SlidingMenu


I've been at this for a couple of days trying to get the library structure correct within Android Studio. I would have just continued with Eclipse, but performance wise, it's been really bad for me lately. Please, any guidance would be greatly appreciated as all solutions found have not worked and the documentation has lead me nowhere.

All manifests have an empty application tag except for the main TestProject.

Edit* Prior to including SlidingMenu, I did have ActionBarSherlock working without issues and building, etc.

The Error

Gradle: Execution failed for task ':libraries:SlidingMenu:processReleaseManifest'.
> Manifest merging failed. See console for more info.

Build.Gradle (SlidingMenu)

apply plugin: 'android-library'

buildscript {
   repositories {
      mavenCentral()
}

  dependencies {
    classpath 'com.android.tools.build:gradle:0.5.+'
  }
}

dependencies {
        compile 'com.android.support:support-v4:13.0.+'
        compile project(':libraries:actionbarsherlock')
    }

android {
    compileSdkVersion 17
    buildToolsVersion '17.0.0'


sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aild.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
        }
    }
}

Build.Gradle (ActionBarSherlock)

apply plugin: 'android-library'

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:0.5.+'
    }
}

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

android {
    compileSdkVersion 17
    buildToolsVersion '17.0.0'

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aild.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
    }
}

Build.Gradle (Test Project)

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

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.android.support:support-v4:13.0.+'
    compile project(':libraries:actionbarsherlock')
    compile project(':libraries:SlidingMenu')
}

android {
    compileSdkVersion 17
    buildToolsVersion "17.0.0"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 16
    }
}

settings.gradle (Test Project)

include ':TestProject',':libraries:actionbarsherlock',':libraries:SlidingMenu'

Solution

  • Unfortunately, this could be happening for a lot of reasons. I'd suggest running gradle build -info from the command line to see if it gives you more information.

    A common merge failure I've run into is when the minSdkVersions are conflicting. I see that your test project minSdkVersion is 7, are the minimum levels declared in the ActionBarSherlock and SlidingMenu manifests 7 or less?