由于库版本不兼容,Android Build执行失败 [英] Android Build execution failed due to incompatible library versions

查看:53
本文介绍了由于库版本不兼容,Android Build执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用firebase实施Google登录。

Implementing Google sign in using firebase.

这是我的项目级别build.gradle

This is my project level build.gradle

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.google.gms:google-services:3.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

这是我的应用程序级别build.gradle

This is my App level build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "wallet.mycoin"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "0.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:design:26.1.0'
    compile 'com.google.code.gson:gson:2.8.2'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.squareup.okhttp:okhttp:2.4.0'
    compile 'com.squareup.okio:okio:1.5.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
    compile 'com.google.firebase:firebase-auth:11.8.0'
    compile 'com.google.android.gms:play-services-auth:11.8.0'
}

在建筑物中,我遇到类似>

While building i am getting an error like >


错误:任务':app:processDebugGoogleServices'执行失败。
请通过更新
google-services插件的版本来解决版本冲突(有关最新版本的信息是
,可在
处找到,网址为
https://bintray.com/android/android-tools/com.google.gms.google- services /
或将com.google.android.gms的版本更新为9.0.0。

Error:Execution failed for task ':app:processDebugGoogleServices'. Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.

<<


所有firebase / gms库必须使用完全相同的规格
(混合版本可能导致运行时崩溃)找到版本9.0.0
和11.8.0。示例包括
com.google.firebase:firebase-analytics:9.0.0和
com.google.android.gms:play-services-auth:11.8.0。

All firebase/gms libraries must use the exact same specification (mixing versions can lead to run time crashes) Found versions 9.0.0 and 11.8.0. Examples include com.google.firebase:firebase-analytics:9.0.0 and com.google.android.gms:play-services-auth:11.8.0.

有一些库组合,或者
不兼容或可能导致错误的工具和库。此类不兼容
会与不是
最新版本(或低于
targetSdkVersion的特定版本)的Android支持库版本一起编译

There are some combinations of libraries , or tools and libraries that are incompatible, or can lead to bugs. One such incompatibility compiling with a version of Android support library that is not the latest version (or in a particular version lower than targetSdkVersion)

项目中未添加Firebase分析库。任何人都可以提出解决方案。

There is no firebase analytics library added in the project. Can anyone suggest a solution. Build failed.

推荐答案

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
compile 'com.google.code.gson:gson:2.8.2'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.okio:okio:1.5.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.google.android.gms:play-services-auth:11.8.0'
}
apply plugin: 'com.google.gms.google-services'

使用此文件,请记住添加google-services配置文件。

Use this file , remember to add google-services configuration file .

这篇关于由于库版本不兼容,Android Build执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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