The 'variable' Firebase Android Studio / Firebase can not be found

1

I have the following code

public class NombreClase extends android.app.Application {
    @Override
    public void onCreate() {
        super.onCreate();
        Firebase.setAndroidContext(this);
    }
}

Firebase throws the error

  

Can not resolve Symbol 'Firebase'.

    
asked by Parzival 21.05.2016 в 03:52
source

2 answers

2

You have to add the dependency in the project's build.gradle file.

compile 'com.firebase:firebase-client-android:2.5.2+' 

Synchronize again and now.
This way they can import the Firebase class.

    
answered by 21.05.2016 / 04:30
source
0

Depends on the use you want to make of Firebase. I recommend that you follow the steps of the documentation of Firebase

For user registration:

compile 'com.google.firebase:firebase-auth:9.6.1

To use database:

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

To store files (images, videos, audio):

compile 'com.google.firebase:firebase-storage:9.6.1'
    
answered by 24.11.2016 в 03:57