0

I get this error in my project when i try to rebuild it:

Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than version 9 declared in library [com.google.android.gms:play-services:9.4.0] C:\Users\Esprit\Desktop\ColoringBook\app\build\intermediates\exploded-aar\com.google.android.gms\play-services\9.4.0\AndroidManifest.xml Suggestion: use tools:overrideLibrary="com.google.android.gms.play_services" to force usage

And when i change 8 to 9 in the build.gradle I get 255 errors.

This is the build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 15
    buildToolsVersion "24.0.3"

    defaultConfig {
        applicationId "com.gkcrop.coloringbook"
        minSdkVersion 8
        targetSdkVersion 17
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:support-v4:20.+'
    compile 'com.google.android.gms:play-services:+'
    compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
    compile files('libs/picasso-2.4.0.jar')
}

This is the Manifest.xml :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.gkcrop.coloringbook"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="17" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:theme="@style/Theme.Sherlock.Light" >
        <activity
            android:name="com.gkcrop.coloringbook.SplashActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.gkcrop.coloringbook.PicSelect"
            android:configChanges="orientation|keyboardHidden|screenSize" >
        </activity>
        <activity
            android:name="com.gkcrop.coloringbook.PicItem"
            android:configChanges="orientation|keyboardHidden|screenSize" >
        </activity>
        <activity
            android:name="com.gkcrop.coloringbook.FloodFillActivity"
            android:configChanges="orientation|keyboardHidden|screenSize" >
        </activity>

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <!-- Activity required to show ad overlays. -->
        <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
    </application>

</manifest>
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Esprit
  • 41
  • 2
  • 6
  • What do you mean you tried to change? `minSdkVersion 8` is still in the Gradle file – OneCricketeer Nov 14 '16 at 17:49
  • Also, I would advise against `play-services:+'` and actually use a version number – OneCricketeer Nov 14 '16 at 17:50
  • You should really, really not use `com.google.android.gms:play-services:+` - consider using the [selective dependencies](https://developers.google.com/android/guides/setup#split) to make your app much, much smaller. – ianhanniballake Nov 14 '16 at 17:50

1 Answers1

3

Your build.gradle has

minSdkVersion 8

That must be changed to

minSdkVersion 9

If you want to use Google Play services (note: the values in your manifest are completely ignored when you use Gradle).

ianhanniballake
  • 191,609
  • 30
  • 470
  • 443