在android studio上将实时数据库添加到我的应用程序-未能解决:firebase-database-15.0.0

在android studio上将实时数据库添加到我的应用程序-未能解决:firebase-database-15.0.0,android,firebase,Android,Firebase,我一直在与firebase合作,以访问我项目中的一项活动。一切正常,没有编译错误。然而,在我进入“工具”>“firebase”后,我可以轻松连接到我的应用程序,但当我尝试单击“添加实时数据库”时,它会显示以下内容: build.gradle will include these new dependencies: compile 'com.google.firebase:firebase-database:16.0.1:15.0.0' 因为compile不推荐使用,所以我使用实现,当我

我一直在与firebase合作,以访问我项目中的一项活动。一切正常,没有编译错误。然而,在我进入“工具”>“firebase”后,我可以轻松连接到我的应用程序,但当我尝试单击“添加实时数据库”时,它会显示以下内容:

build.gradle will include these new dependencies:
    compile 'com.google.firebase:firebase-database:16.0.1:15.0.0'
因为compile不推荐使用,所以我使用实现,当我这样做时


实现'com.google.firebase:firebase数据库:16.0.1:15.0.0'

无法解决以下错误:firebase-database-15.0.0

而我的同步失败。

将Root Gradle更改为

和应用程序Gradle To

希望这可以帮助您在项目级渐变中添加jcenter

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

继续保持@Tomin B所说的状态。

关闭gradle脱机同步选项,再次尝试感谢您的回复,dude,但请告诉我如何做到这一点,以及我应该使用哪种firebase版本?16.0.1:15.0.0或当前版本?com.google.firebase:firebase数据库:16.0.1go to settings->build and execution->gradle->uncheck offline work选项并单击ok…..它已经被取消选中,而且也不起作用。通过将其设置为“com.google.firebase:firebase database:16.0.1”,它告诉我再次更改为16.0.1:15.0.0…我已经从以前的研究中获得了这些设置,但仍然没有。这就是我的gradle应用程序的功能:implementation'com.google.firebase:firebase core:16.0.1'implementation'com.google.firebase:firebase数据库:16.0.1'implementation'com.google.firebase:firebase auth:16.0.1'对于类路径的依赖关系。。。classpath'com.google.gms:googleservices:4.0.1'我已经在所有项目和buildscript上有了它,让我再次解释一下,我需要验证/添加实时数据库,但我不能。它告诉我接受更改,但如果我接受更改,则不会更改任何内容,并且会收到日志错误。因为否则,每当我尝试登录时,它都会返回无效的\u密码,并在logcat@PublioElon我想我不理解您的问题,根据您的上述评论,我理解您正试图使用firebase assistance在android studio中添加firebase数据库依赖项。但是我无法知道你要登录的地方,你可以发布什么错误日志?老兄,我甚至不知道怎么说,我只是觉得我是文盲,它不起作用的原因是因为在提到新的意图时,我输入了错误的意图名称,没有注意到,我花了7个小时,试图在互联网上查找错误,当它一直以来,我觉得很愚蠢。。。
apply plugin: 'com.android.application'

android {
  // ...
}

dependencies {
  // ...
  implementation 'com.google.firebase:firebase-core:16.0.1'
  implementation 'com.google.firebase:firebase-database:16.0.1'

  // Getting a "Could not find" error? Make sure you have
  // added the Google maven respository to your root build.gradle
}

// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
allprojects {
    repositories {
        google()
        jcenter()
    }
}