【问题标题】:Failed to resolve: com.google.firebase:firebase-core:11.0.0无法解决:com.google.firebase:firebase-core:11.0.0
【发布时间】:2017-11-15 09:49:48
【问题描述】:

我已经看到了这个问题,并按照重新同步项目和更新SDK 的方式进行了回复。我刚开始一个新项目并尝试使用firebase 设置身份验证,但出现以下错误

android studio 只是恨我吗?

错误:无法解决:com.google.firebase:firebase-core:11.0.0 打开 文件
显示在 项目结构对话框 Error:Error:line (29)Failed to resolve: com.google.firebase:firebase-auth:11.0.0 Show in 文件
显示在 项目结构对话框

【问题讨论】:

标签: android firebase android-gradle-plugin


【解决方案1】:

转到 Tools > Android > SDK Manager 点击 SDK Tools 并更新以下内容:

  • Google 存储库
  • Android SDK 平台工具

【讨论】:

  • 赞成 ;)
  • 我已经更新了这两个,但我仍然得到与 OP 相同的错误。
【解决方案2】:

只需转到 sdk 管理器并更新 google 存储库。

【讨论】:

  • 非常感谢 :)
  • 请将答案标记为正确以感谢任何人。快乐的编码。
  • 对不起,这样的新手
【解决方案3】:

enter image description here

您只能点击 AddAnalytics 到您的应用 跟随 这个https://firebase.google.com/docs/android/setup

【讨论】:

    【解决方案4】:

    我能够通过使用 10.0.0 解决此问题

    感谢大家的帮助

    尼克

    【讨论】:

    • 我刚刚尝试使用 firebase 11.2 进行编译,因为它是在他们的网站上(今天)写的,但它也无法解决,所以我将 firebase 版本降低到 11 并且它有效 = )
    【解决方案5】:

    适用于 android studio 4.1.2。

    1. 首先确保您已从 SDK 管理器安装了 google play 服务。转到android studio菜单上的工具-SDK管理器-SDK工具如果没有安装它。
    2. 将您的应用连接到 Firebase。在工具上单击 firebase,firebase 将打开一个新窗口,单击分析。它会引导你到firebase站点,从那里创建一个项目,它会自动选择你的项目。 3.当您返回您的项目时,您会看到“已连接到 Firebase” 4.so如果你运行你的项目并得到错误-找不到com。谷歌。火力基地 19.3.1 将此粘贴到您的项目/ build.gradle 依赖项上的类路径 'com.google.gms:google-services:4.3.5' - 不要忘记立即同步 然后在文件底部/末尾的 app/build.gradle 上粘贴这个 应用插件:'com.google.gms.google-services' 5.重建您的项目并再次运行。

    NB/classpath 'com.google.gms:google-services:4.3.5'
    应用插件:'com.google.gms.google-services'

    如果有帮助请留言。

    【讨论】:

      【解决方案6】:

      确保您的项目级 build.gradle 文件包含以下内容:

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

      【讨论】:

        【解决方案7】:

        行顺序对于 Gradle 非常重要。

        1) 构建脚本 { ext.kotlin_version = '1.2.20'

        repositories {
            maven { url "https://maven.google.com" }
            maven { url 'https://plugins.gradle.org/m2/'}
        }
        
        dependencies {
            classpath 'com.android.tools.build:gradle:2.3.3'
            classpath 'com.google.gms:google-services:3.0.0'//3.2.0
            classpath 'com.google.firebase:firebase-plugins:1.0.4'
            classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.8.1'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        }
        }
        

        2)

        dependencies {
        compile project(':libraries')
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
        //--------------------------------- One Signal-------------------
        //compile 'com.onesignal:OneSignal:[3.1.1, 3.3.99]'
        compile 'com.google.android.gms:play-services-gcm:11.0.4'
        compile 'com.google.android.gms:play-services-location:11.0.4'
        compile 'com.google.firebase:firebase-core:11.0.4'
        compile 'com.google.firebase:firebase-messaging:11.0.4'
        //-------------------------------------------------------------
        compile 'com.android.support:multidex:1.0.1'
        compile 'com.android.support:percent:26.0.0-alpha1'
        compile 'com.android.support:design:26.0.0-alpha1'
        compile 'com.android.support:support-v4:26.0.0-alpha1'
        compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
        compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
        compile 'com.android.support:cardview-v7:26.0.0-alpha1'
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
        }
        
        apply plugin: 'com.google.gms.google-services'
        

        祝你好运

        【讨论】:

          猜你喜欢
          • 2022-01-10
          • 2021-04-20
          • 2018-11-08
          • 2018-01-23
          • 2016-09-15
          • 2019-03-25
          • 2017-03-04
          • 2018-09-24
          • 1970-01-01
          相关资源
          最近更新 更多