更新 PlayServices 和 Firebase 新版本 10.2.0 时出现问题 [英] Problems updating new version 10.2.0 of PlayServices and Firebase

查看:19
本文介绍了更新 PlayServices 和 Firebase 新版本 10.2.0 时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Android Studio 开发了一个 Android 应用,今天收到消息说有新版本的 Google Play 服务和 Firebase.

<块引用>

从 10.0.1 到 10.2.0.

我正在使用 Google Play 服务分析和广告.

我已经选择了 API min 9,现在我认为广告无法在 API 中展示 <14 .

我的 build.gradle 文件:

 应用插件:'com.android.application'安卓 {compileSdkVersion 25构建工具版本25.0.0"默认配置 {applicationId "com.ilyo.x1application"minSdkVersion 9targetSdkVersion 25版本代码 1版本名称1.0"testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"}构建类型 {发布 {缩小启用假proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}}依赖{编译 fileTree(dir: 'libs', include: ['*.jar'])androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {排除组:'com.android.support',模块:'support-annotations'})编译'com.android.support:appcompat-v7:25.1.1'编译'com.google.firebase:firebase-ads:10.2.0'编译'com.google.firebase:firebase-core:10.2.0'编译'com.google.android.gms:play-services-ads:10.2.0'测试编译'junit:junit:4.12'}应用插件:'com.google.gms.google-services'

错误信息

<块引用><块引用>

错误:任务 ':app:processDebugManifest' 执行失败.清单合并失败:uses-sdk:minSdkVersion 9 不能小于库中声明的版本 14[com.google.firebase:firebase-ads:10.2.0]

/Users/mac/Documents/AndroidStudioProjects/Project1/app/build/intermediates/exploded-aar/com.google.firebase/firebase-ads/10.2.0/AndroidManifest.xml建议:使用工具:overrideLibrary="com.google.firebase.firebase_ads" 强制用法

我希望我的应用程序的所有广告都可以在所有设备上展示,您有什么建议?

解决方案

10.2.0 版本的 ALL google 相关服务至少需要 API 版本 14.这是 Google 做的选择,所以他们不必支持14以下的API版本.

因此,如果您想支持低于 14 的 API 版本,则必须永远坚持使用 10.0.1 版本.或者,您必须将应用的最低 API 版本提高到 14,然后使用新的 google 服务.

文章:https://www.xda-developers.com/google-play-services-release-notes-are-available-for-the-10-2-update-bye-gingerbread/

I develop an Android app using Android Studio and I got the message today that there is a new version of Google Play services and Firebase.

From 10.0.1 to 10.2.0.

I'm using Google play services analytics and ads that's all.

I am already choose an API min 9 and Now I think the ads can't be show in API < 14 .

My build.gradle File:

 apply plugin: 'com.android.application'

android {

    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.ilyo.x1application"
        minSdkVersion 9
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.1.1'
    compile 'com.google.firebase:firebase-ads:10.2.0'
    compile 'com.google.firebase:firebase-core:10.2.0'
    compile 'com.google.android.gms:play-services-ads:10.2.0'
    testCompile 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'

Error Message

Error:Execution failed for task ':app:processDebugManifest'. Manifest merger failed : uses-sdk:minSdkVersion 9 cannot be smaller than version 14 declared in library [com.google.firebase:firebase-ads:10.2.0]

/Users/mac/Documents/AndroidStudioProjects/Project1/app/build/intermediates/exploded-aar/com.google.firebase/firebase-ads/10.2.0/AndroidManifest.xml Suggestion: use tools:overrideLibrary="com.google.firebase.firebase_ads" to force usage

I want to all my ads of my Application can show in all devices, What do you recommend ?

解决方案

The 10.2.0 version of ALL google related services require a minimum of API version 14. This is a choice done by Google, so they don't have to support API versions below 14.

So you'll have to stick to version 10.0.1 forever if you want to support API versions below 14. Or, you will have to raise your apps minimum API version to 14, and then use the new google services.

Article: https://www.xda-developers.com/google-play-services-release-notes-are-available-for-the-10-2-update-bye-gingerbread/

这篇关于更新 PlayServices 和 Firebase 新版本 10.2.0 时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆