0
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
    implementation 'com.android.support:exifinterface:28.0.0-alpha3'
    implementation 'com.android.support:support-media-compat:28.0.0-alpha3'
    implementation 'com.android.support:support-v4:28.0.0-alpha3'
    implementation 'com.android.support:design:28.0.0-alpha3'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:support-vector-drawable:28.0.0-alpha3'
    implementation 'com.google.firebase:firebase-messaging:11.8.0'
    implementation 'com.google.firebase:firebase-storage:11.8.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.google.firebase:firebase-auth:11.8.0'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.firebaseui:firebase-ui-database:4.1.0'    
}

These are my dependencies but it is giving me gradle errors, its because of the FirebaseUI dependency as when I delete that the app builds fine.

Can anyone help me how to resolve this? I know its most probably some version issue.

Peter Haddad
  • 78,874
  • 25
  • 140
  • 134
Omer Mujtaba
  • 21
  • 1
  • 9

2 Answers2

3

According to the docs:

As of version 4.1.0, FirebaseUI has the following dependency versions:

Library         Version
firebase-auth       16.0.1
play-services-auth  15.0.1
firebase-database   16.0.1
firebase-firestore  17.0.1
firebase-storage    16.0.1

Update the following to dependencies:

implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'

to this:

implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.firebase:firebase-storage:16.0.1'

Also add:

    implementation 'com.google.firebase:firebase-core:16.0.1'

Your app gradle file now has to explicitly list com.google.firebase:firebase-core as a dependency for Firebase services to work as expected.

In the top level gradle file use the following google-service plugin:

classpath 'com.google.gms:google-services:4.0.2'
Peter Haddad
  • 78,874
  • 25
  • 140
  • 134
  • Although, I did run into another issue, I hope you could help, I am trying to load all the users in an activity using recycler view, everything seems to be fine but im getting a blank screen, I hope you could help me once again. Here is the gist with all the codes: https://gist.github.com/omermujtaba/b1fd5f47285252b7726c8588ebec8d1f – Omer Mujtaba Jul 30 '18 at 07:02
  • If you are using `FirebaseRecyclerAdapter` then most probably this is your problem: https://stackoverflow.com/questions/47228262/firebaselistadapter-not-pushing-individual-items-for-chat-app-firebase-ui-3-1/47228433#47228433. If not then better ask another question with the required code and specifying what us happening exactly. – Peter Haddad Jul 30 '18 at 07:04
  • Under `recyclerView.setAdapter(firebaseRecyclerAdapter);`, write `firebaseRecyclerAdapter.startListening();` – Peter Haddad Jul 30 '18 at 07:07
0

If FirestoreRecyclerAdapter is showing an error means.....

just add these dependencies

implementation 'com.firebaseui:firebase-ui-firestore:8.0.1'
implementation 'com.google.firebase:firebase-core:19.0.2'

This will work fine

Saeed Zhiany
  • 2,051
  • 9
  • 30
  • 41