我在我的项目得到这个错误,宣布第9版更小,当我试图重建它:清单合并失败:使用-SDK:的minSdkVersion 8不能超过在库
错误:执行失败的任务“:应用程序: 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
而当我在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:[email protected]'
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>
你是什么意思你试图改变? 'minSdkVersion 8'仍然在Gradle文件中 –
另外,我建议不要使用'play-services:+'并实际使用版本号 –
您应该真的不使用'com.google.android.gms:play-服务:+' - 考虑使用[选择性依赖关系](https://developers.google.com/android/guides/setup#split)让您的应用程序变得更小,更小。 – ianhanniballake