Reputation: 341
I am following the firebase assistant and video tutorial. I am receiving an error and it says that (see picture below)
Here is my code:
I had the same problems with Button
, EditText
, and View
; but I resolved that by adding import statements. Is there any way import Firebase?
Upvotes: 2
Views: 8163
Reputation: 1024
Firebase Console
and add your required dependecies
like com.google.firebase:firebase-database:11.4.0
you have to add this line in your app/build.gradle
core dependency
in app/build.gradle
which is compile 'com.google.firebase:firebase-core:11.4.0'
android {
// ...
}
dependencies {
// ...
compile 'com.google.firebase:firebase-database:11.4.0'
compile 'com.google.firebase:firebase-core:11.4.0'
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
snippet
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:3.1.0' // google-services
plugin
}
}
allprojects {
// ...
repositories {
// ...
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
Upvotes: 1
Reputation: 363815
Just import com.google.firebase.database.FirebaseDatabase
Upvotes: 2