简体   繁体   English

无法解决:com.google.firebase:firebase-core:11.2.0

[英]Failed to resolve: com.google.firebase:firebase-core:11.2.0

I'm getting multiple "Failed to Resolve" issues when syncing my project. 同步我的项目时出现多个“无法解决”问题。 They are all firebase and play-services related. 它们都是与Firebase和Play服务相关的。 I made sure they are all the same (11.2.0). 我确保它们都是相同的(11.2.0)。 I've also checked and the latest version for both is 11.2.0. 我还检查了两者的最新版本是11.2.0。 Also, all the other answers to similar questions involve updating Google play services and repository in the SDK Manager but mine is already up to date. 此外,所有其他类似问题的答案都涉及在SDK Manager中更新Google Play服务和存储库,但是我的已经是最新的了。

在此处输入图片说明

在此处输入图片说明

Any idea why I can't sync my project? 知道为什么我无法同步我的项目吗?

EDIT - Current working solution 编辑-当前工作解决方案

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.google.firebase:firebase-plugins:1.0.4'

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

allprojects {
    repositories {
        jcenter()
        maven { url "https://maven.google.com" } 
    }
}

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

Add maven { url "https://maven.google.com" } to your root level build.gradle file maven { url "https://maven.google.com" }到您的根目录build.gradle文件中

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

Play services and Firebase dependencies are now available via maven.google.com with the release of version 11.2.0 of Google Play services and Firebase. 随着Google Play服务和Firebase 11.2.0版的发布,现在可以通过maven.google.com获得Play服务Firebase依赖项。

You can find the Google Play Services official doc here and the firebase doc here. 您可以在此处找到Google Play服务官方文档,并在此处找到Firebase文档。 .

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
    }
}

If you are using the android gradle plugin 3.x you can also use: 如果您使用的是android gradle插件3.x,则还可以使用:

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

我只是通过添加firebase-core依赖关系来修复了相同的错误。

implementation 'com.google.firebase:firebase-core:16.0.1'

With the 16.0.0 release of firebase I had to 随着16.0.0版本的发布,我不得不

  • set most my google play services libraries to 15.0.0 analytics and tagmanager needed to be 16.0.0 将我的大部分 Google Play服务库设置为15.0.0分析,并将tagmanager设置为16.0.0
  • set my support library versions to 27.1.1 将我的支持库版本设置为27.1.1
  • firebase-core to 16.0.0 16.0.0 -core到16.0.0

Built against sdk 27 针对sdk 27​​构建

Extra Changes: 额外更改:

I also had to update my analytics to 16.0.0 我还必须将分析更新为16.0.0

  • implementation "com.google.android.gms:play-services-analytics:16.0.0" 实现“ com.google.android.gms:play-services-analytics:16.0.0”

Part of the independent versions thing Android did recently I am guessing. 我猜,Android最近做了一些独立版本的事情。 May need to try going up or down a version on the google play services and firebase libraries 可能需要尝试在Google Play服务和Firebase库上提升或降低版本

The best Method to fix this problem is not using the manual method of linking firebase to your app. 解决此问题的最佳方法是不使用将Firebase链接到您的应用程序的手动方法。

I have tried adding latest firebase repo by referring to this Link . 我尝试通过引用此Link添加最新的Firebase回购。

It showed error " failed to resolve the dependencies firebase 11.2.0" 它显示错误“无法解决依赖项firebase 11.2.0”

FireBase recommends adding firebase to your app with the help of FireBase Assistant for Android Studio Version 2.2 and Higher. FireBase建议借助适用于Android Studio 2.2及更高版本的FireBase助手将Firebase添加到您的应用程序。 Manually adding the latest library to build-gradle(module) result in an error as above. 手动将最新的库添加到build-gradle(module)会导致上述错误。

Firebase assistant added lower versions 10.0.1 automatically to dependencies on the module gradle-build which is compatible and could be resolved. Firebase助手自动将较低版本10.0.1添加到对gradle-build模块的依赖关系中,该版本是兼容的并且可以解决。

Using Firebase assistant is so easy and 2 step process. 使用Firebase助手非常简单,只需2个步骤。 For reference, You can use the "Use the Firebase Assistant" section on the same link mentioned above. 作为参考,您可以在上述同一链接上使用“使用Firebase助手”部分。

It Really worked Out with my Android Studio 2.3.3. 我的Android Studio 2.3.3确实可以解决此问题。 And also make sure Your Google Repository is up to date 还要确保您的Google Repository是最新的

从工具-> SDK管理器-> SDK工具安装谷歌播放服务和谷歌存储库并同步您的项目将正常工作

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

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