简体   繁体   English

使用minSdkVersion 7

[英]Use minSdkVersion 7

I need in my app this piece of code: 我在我的应用程序中需要以下代码:

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

But I also need the minSdkVersion to be 7, and tha doesn't work. 但是我还需要将minSdkVersion设置为7,并且tha无法正常工作。 The error: 错误:

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 7 cannot be smaller than version 9 declared in library com.google.android.gms:play-services:6.1.71

This is the content of my Gradle: 这是我的Gradle的内容:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "codificador.aplicacion.safrapp.codificadorandroid"
        minSdkVersion 7
        targetSdkVersion 21
        versionCode 1
        versionName "1.0.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.0'
    //compile 'com.google.android.gms:play-services:6.+'
}

Isn't there an smaller version of compile 'com.google.android.gms:play-services?, because this is what causes my error. 没有更小的编译'com.google.android.gms:play-services?版本,因为这是导致我出错的原因。

UPDATE: I changed it to compile 'com.google.android.gms:play-services:5.0.89' New error: 更新:我将其更改为compile 'com.google.android.gms:play-services:5.0.89'新错误:

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 7 cannot be smaller than version 9 declared in library com.google.android.gms:play-services:5.0.89

Finally understand your problem . 最后了解你的问题。 Google Play Services is supported on Android 2.3.3 and above.Set this : Android 2.3.3及更高版本支持Google Play Services

compile 'com.google.android.gms:play-services:6.1.71' // or 6.1.+

or 要么

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

And set minSdkVersion 15 . 并设置minSdkVersion 15 I hope it helps you a lot 希望对您有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM