android - minSdkVersion 9 不能小于库中声明的版本 14

标签 android android-gradle-plugin google-play-services build.gradle

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

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

apply plugin: 'com.android.application'

android {
    compileSdkVersion 17
    buildToolsVersion "26.0.2"

    defaultConfig {
        applicationId "com.shaker.voicetranslator"
        minSdkVersion 9
        targetSdkVersion 17
    }

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

dependencies {
    compile 'com.android.support:appcompat-v7:18.0.0'
    compile 'com.google.android.gms:play-services:+'

最佳答案

您正在使用

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

您的 SDK 管理器中的此库已通过 com.google.android.gms:play-services:11.0.4 解析(请注意,如果您想使用最新版本,您必须使用 add the google maven repo ) .
此依赖项具有 minSdk =14,您不能使用 minSdk=9。

你必须改变

minSdkVersion 9

minSdkVersion 14

此外,由于您将依赖于最新的支持库,因此您必须更改用于编译的 API。使用:

compileSdkVersion 26

关于android - minSdkVersion 9 不能小于库中声明的版本 14,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46505207/

相关文章:

java - Android SDK 如何实现 OnClickListener

android - 更改 tabHost 上的文本大小

android - Android 中的 Google Play 服务库

android - 在 react-native 0.60 中找不到用于签名配置 '/Project-Folder/android/app/debug.keystore' 的 keystore 文件 'debug'

java - Android:在后台打开应用程序,而不是新任务

添加新库后,Android Studio 构建速度变慢?

android - Gradle 发布到 Artifactory 的特定仓库

android - 无法读取映射文件,Gradle任务执行异常[Android]

android - 使用 Google Play 游戏服务联系用户

android - 是否可以将 Google Play 游戏服务实时多人游戏集成到适用于 Android 和 iOS 的 LibGDX 中?