小编Rom*_*ana的帖子

确保首先调用FirebaseApp.initializeApp(Context)

它可能与其他问题完全相同,但我真的不知道这里有什么问题.在此先感谢您的帮助.

build.gradle(项目)

        // 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.1.0'

        // 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" // Google's Maven repository
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)

的build.gradle(模块)的

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion …
Run Code Online (Sandbox Code Playgroud)

android firebase firebase-realtime-database

1
推荐指数
3
解决办法
8734
查看次数