0
votes

I had this problem:

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\Alphabet AdMob\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

But when i change "minSdkVersion 8" to "minSdkVersion 9" I get 255 errors

Manifest :

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

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.GET_TASKS" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.viavilab.alphabet.Splash_Activity"
            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.viavilab.alphabet.CapitalAlphabet_Activity"
            android:configChanges="orientation|keyboardHidden" >
        </activity>
        <activity
            android:name="com.viavilab.alphabet.MainActivity"
            android:configChanges="orientation|keyboardHidden" >
        </activity>
        <activity
            android:name="com.viavilab.alphabet.SmallAlphabet_Activity"
            android:configChanges="orientation|keyboardHidden" >
        </activity>
        <activity
            android:name="com.viavilab.alphabet.AboutActivity"
            android:configChanges="orientation|keyboardHidden" >
        </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>

build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'Google Inc.:Google APIs:15'
    buildToolsVersion "24.0.3"

    defaultConfig {
        applicationId "com.viavilab.alphabet"
        minSdkVersion 8
        targetSdkVersion 18
    }

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

dependencies {
    compile 'com.android.support:support-v4:18.0.0'
    compile 'com.google.android.gms:play-services:+'
}
1
try changing gms play services versionAman Verma
But how ? Can you help me please ?Esprit
add tools:overrideLibrary to android manifest as suggested by the errorSandeep Londhe
I deleted : <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" /> and added : <uses-sdk tools:overrideLibrary="com.google.android.gms.play_services" /> but i get the same problemEsprit
You should not be deleting the standard uses-sdk! Just add a second one with the overrideLibrary.lionscribe

1 Answers

0
votes

As you can read in the official doc about Setting up Google Play Services, the minSdkVersion must be 9. Even they are informing in the release notes, Google Play services 10.0.x is the final release that includes full support for Android version 2.3.x (Gingerbread).

By the way, in your build.gradle file, replace your compileSdkVersion to 18. You are already adding google play services to your app, as you can see in your dependencies.

compileSdkVersion 18

A tip: I think is highly recommendable to set a version to libraries you are using. The plus character in a dependency means you are using the latest version of the library. Every time app is built, you will use the latest version and maybe, your app can be incompatible with it or there are some bugs in the library you don't want to include in your app. So, set the version you want to use. For example,

compile 'com.google.android.gms:play-services:10.0.1'