com.google.gms:google-services Firebase插件的兼容性问题 [英] com.google.gms:google-services Compatibility Issue with Firebase plugins

查看:155
本文介绍了com.google.gms:google-services Firebase插件的兼容性问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天试图更新一个旧项目,我遇到了一个问题(在Android上),我认为这与其中一个Firebase插件有关. 我不断收到以下错误:

Trying to get an old project up to date today, I ran into an issue (on Android) which I believe has to do with one of the Firebase plugins. I keep on getting the following error:

失败:生成失败,发生异常.

FAILURE: Build failed with an exception.

出了什么问题:

各种其他库都在[[15.0.1,15.0.1]]请求库com.google.android.gms:play-services-base,但解析为11.8.0.禁用插件,并使用./gradlew:app:dependencies检查您的依赖关系树.

The library com.google.android.gms:play-services-base is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 11.8.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

这是我的pubspec文件中的片段,用于显示项目中的插件:

Here is a snippet from my pubspec file to show the plugins in my project:

dependencies:
  flutter:
    sdk: flutter
  firebase_auth: ^0.5.18
  firebase_storage: ^1.0.1
  cloud_firestore: ^0.7.4
  firestore_helpers: ^2.0.5
  image_picker: ^0.2.0
  location: 1.1.6
  flutter_webview_plugin: 0.0.9+1
  font_awesome_flutter: 4.7.2
  flutter_map: ^0.0.1

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.0

此代码段显示了项目的当前状态,以及Firebase产品的所有新版本.
当然,我也确实更新了build.gradle文件,它们看起来像这样的atm:

This snippet shows the project in its current state, with all the new versions for the Firebase products.
I did also update my build.gradle files of course, they look like this atm:

Android级build.gradle文件:

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.google.gms:google-services:4.0.1'
    }
}

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

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

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

应用程序级别的build.gradle文件:

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withInputStream { stream ->
        localProperties.load(stream)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.3'

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.test.tester"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
        profile {
            matchingFallbacks = ['debug', 'release']
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
apply plugin: 'com.google.gms.google-services'

我相信这是我根据文档所做的全部工作,但也许我错过了一些事情.
有谁知道如何解决这个问题?

I believe that is all that I had to do according to the docs, but perhaps I missed something.
Any one an idea on how to fix this?

推荐答案

打开此链接,其中包含您需要使用的Firebase库版本的列表

open this link, this contains the list of Firebase libraries versions that you need to use

这篇关于com.google.gms:google-services Firebase插件的兼容性问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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