Jaimin Modi
Jaimin Modi

Reputation: 1667

Issue with Firebase Realtime Database

I am using Firebase Real time databse in my android application.

I have used dependecy as below :

inside : (build.gradle:)

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.0.0'
compile "com.google.firebase:firebase-auth:9.0.2"

//compile 'com.google.firebase:firebase-core:10.2.1'
//compile 'com.google.firebase:firebase-database:10.2.1'

testCompile 'junit:junit:4.12'

} apply plugin: 'com.google.gms.google-services'

and inside App-Level gradle file I have used :

dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'
    classpath 'com.google.gms:google-services:3.0.0'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

I have used classes : DatabaseReference and FirebaseDatabase.

But, both the classes could not Found. is there any dependency missing ?

Pls. tell. Thanks.

Upvotes: 0

Views: 484

Answers (4)

husen
husen

Reputation: 180

If You Don't Know Which Gradle Is Missing When Using FireBase There Is An Android In Built Plugin For FireBase. Steps:(Tools)->(Firebase) Click On FireBase Then Its Open Right Side One Menu There Is All Options Available Like Firebase Auth, Firebase Storage,Firebase Database Click Which one You Configure In Your app. then there is a whole steps..for connect firebase

Upvotes: 1

Ratilal Chopda
Ratilal Chopda

Reputation: 4220

You need to add this build.gradle

compile 'com.google.firebase:firebase-database:9.2.1'  
compile 'com.google.firebase:firebase-auth:9.2.1'

Upvotes: 0

Alex Mamo
Alex Mamo

Reputation: 138804

You need to add this line to your build.gradle file.

compile 'com.google.firebase:firebase-database:9.0.2'

But i recomand you using the last versin. Please take a look at FirebaseUI.

Hope it helps.

Upvotes: 1

nirav shah
nirav shah

Reputation: 31

You need to add this line to your build.gradle file.

build.gradle
dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
        classpath 'com.google.gms:google-services:3.0.0'

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

app/build.gradle

 dependencies {
        // Adding support library for this demo app
        compile 'com.android.support:design:24.2.1'

        compile 'com.google.firebase:firebase-database:9.6.1'
    }

    apply plugin: 'com.google.gms.google-services'

Hope it helps.

Upvotes: 0

Related Questions