【问题标题】:Firebase - cannot resolve symbol [duplicate]Firebase - 无法解析符号[重复]
【发布时间】:2017-12-01 10:59:43
【问题描述】:

我使用 Firebase 作为我的云服务器。我想制作一个简单的数据库列表,但我无法解决无法解析符号 Firebases

依赖项是:

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.google.firebase:firebase-database:11.4.0'
    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'
    compile 'com.google.firebase:firebase-core:11.4.0'
    compile 'com.google.firebase:firebase-database:11.4.0'
}

【问题讨论】:

  • 您连接到 Firebase 控制台了吗?还有编译和实现 'com.google.firebase:firebase-database:11.4.0' ,不应该只是实现..

标签: android firebase firebase-realtime-database


【解决方案1】:

您需要在模块 gradle 文件的依赖项之后添加“apply plugin: 'com.google.gms.google-services'”并使用:

repositories {
    maven {
        url "https://maven.google.com"
    }
}

在您的项目 gradle 文件中。

【讨论】:

  • 我添加了它,但它继续出错。
  • 然后尝试删除" implementation 'com.google.firebase:firebase-database:11.4.0'" 并检查
  • 错误仍然存​​在。
猜你喜欢
  • 2017-08-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-10-06
  • 1970-01-01
  • 2021-06-23
相关资源
最近更新 更多