Firebase authentication works perfectly. 

The project Structure is this where I added google service json file

![The project Structure is this where I added google service json file](https://i.stack.imgur.com/kNAAy.png). 

The app is connected with Firebase database 

![Firebase database](https://i.stack.imgur.com/4D0x5.png). 

Whenever I just add `databaseReference = FirebaseDatabase.getInstance().getReference("message");` , The app crashes. I am not sure what I have done wrong. The crash report is 

> 
> java.lang.NoSuchMethodError: No virtual method zzckb()Z in class Lcom/google/firebase/FirebaseApp; or its super classes (declaration of 'com.google.firebase.FirebaseApp' appears in /data/app/com.example.kumarsaikat.firebaseone-hQwEzX\_xqG5IhkEG8WahzQ==/base.apk)
>  at com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source:111)
>  at com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source:4)
>  at com.example.kumarsaikat.firebaseone.ProfileActivity.onCreate(ProfileActivity.java:38)
>  at android.app.Activity.performCreate(Activity.java:7091)
>  at android.app.Activity.performCreate(Activity.java:7082)
>  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
>  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2747)
>  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2872)
>  at android.app.ActivityThread.-wrap11(Unknown Source:0)
>  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1601)
>  at android.os.Handler.dispatchMessage(Handler.java:106)
>  at android.os.Looper.loop(Looper.java:164)
>  at android.app.ActivityThread.main(ActivityThread.java:6600)
>  at java.lang.reflect.Method.invoke(Native Method)
>  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:518)
>  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:821)
> 
> 
>