清单合并失败:uses-sdk:minSdkVersion 8不能小于库中声明的版本9

时间:2016-11-14 17:42:55

标签: android android-gradle android-manifest

当我尝试重建它时,我的项目中出现此错误:

错误:任务':app:processDebugManifest'执行失败。

  

清单合并失败:uses-sdk:minSdkVersion 8不能小于库中声明的版本9 [com.google.android.gms:play-services:9.4.0] C:\ Users \ Esprit \ Desktop \ ColoringBook \应用程序\编译\ \中间体爆炸-AAR \ com.google.android.gms \播放服务\ 9.4.0 \ AndroidManifest.xml中       建议:使用工具:overrideLibrary =" com.google.android.gms.play_services"强制使用

当我在build.gradle中将8更改为9时,我得到255个错误。

这是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')
}

这是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>

1 个答案:

答案 0 :(得分:3)

您的build.gradle

minSdkVersion 8

必须改为

minSdkVersion 9

如果您想使用Google Play服务(请注意:使用Gradle时,您的清单中的值会被完全忽略)。