android - 错误:(8, 5)uses-sdk:minSdkVersion 8不能小于库中声明的版本9

标签 android

您好,我正在尝试遵循本教程

Link

完成所有操作后, list 中出现错误

Error:(8, 5) uses-sdk:minSdkVersion 8 cannot be smaller than version 9                declared in library     C:\Users\Zezo2\AndroidStudioProjects\AndroidPushNotificationsUsingGCM1\app\build    \intermediates\exploded-aar\com.google.android.gms\play-    services\6.5.87\AndroidManifest.xml


Error:(8, 5) Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than      version 9 declared in library C:\Users\Zezo2\AndroidStudioProjects\AndroidPushNotificationsUsingGCM1\app\build\intermediates\exploded-aar\com.google.android.gms\play-services\6.5.87\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.google.android.gms" to force usage

这是我的 build.geadle

    apply plugin: 'com.android.application'

android {
compileSdkVersion 'Google Inc.:Google APIs:8'
buildToolsVersion "21.1.1"

defaultConfig {
    applicationId "com.androidhive.pushnotifications"
    minSdkVersion 8
    targetSdkVersion 16
}

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:+'

}

最佳答案

基本上,您使用的库也有您需要遵守的最低 SDK 版本..

uses-sdk:minSdkVersion 8 cannot be smaller than version 9

您需要编辑您的 Android 项目来更新您的 minSdkVersion

  • 更新 src/build.gradle - 确保是 src 文件夹下的
  • 同步渐变按钮
  • 重建项目
  • 更新 build.gradle minSdkVersion 后,您必须单击 同步 gradle 文件的按钮(“将项目与 Gradle 文件同步”)。

关于android - 错误:(8, 5)uses-sdk:minSdkVersion 8不能小于库中声明的版本9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28782639/

相关文章:

android - 如何用 Luaj 评估一个简单的表达式?

android - 使用 this.setVolumeControlStream(AudioManager.STREAM_MUSIC);当 Activity 失焦时控制 android 手机摇杆(有服务)?

android - 在 Android 中安排操作或警报

android - API 传递经度/纬度并返回城市名称

android - 如何从应用程序内启动 Android 模式锁屏

android - Gradle 找不到不存在的依赖项 - Android 工作室

Android TTS 错误

android - 在 Android 手机中使用 Chrome 应用程序( postman )

android - 从哪里开始使用 I2C 的 Android 驱动程序

java - 为什么程序会意外停止?