1

QueryDocumentSnapshot is not cannot be resolving. I tried to change the versions of firebase-firestore and firebase-core dependencies but still doesn't work.

Here are the firebase imports:

import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.firestore.DocumentReference;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.QueryDocumentSnapshot;
import com.google.firebase.firestore.QuerySnapshot;

here are the dependencies

    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-auth:11.8.0'
    implementation 'de.hdodenhof:circleimageview:3.0.0'
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    implementation 'com.android.support:support-v4:26.1.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
    implementation 'com.getbase:floatingactionbutton:1.10.1'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
    implementation 'com.google.firebase:firebase-storage:11.8.0'
    implementation 'com.google.firebase:firebase-firestore:11.8.0'
    implementation 'com.google.firebase:firebase-core: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.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation files('libs/activation.jar')
    implementation files('libs/additionnal.jar')
    implementation files('libs/mail.jar')

Alex Mamo
  • 130,605
  • 17
  • 163
  • 193
Saba Nayab
  • 63
  • 8

1 Answers1

1

To solve this, please change the following dependencies:

implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-firestore:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'

With the corresponding last versions:

implementation 'com.google.firebase:firebase-storage:16.1.0'
implementation 'com.google.firebase:firebase-firestore:18.2.0'
implementation 'com.google.firebase:firebase-core:16.0.8'

Be also sure to have:

classpath 'com.google.gms:google-services:4.2.0'

In your build.gradle (Project) file.

Peter Haddad
  • 78,874
  • 25
  • 140
  • 134
Alex Mamo
  • 130,605
  • 17
  • 163
  • 193
  • java.lang.NoSuchMethodError: No virtual method zzbqp()Ljava/lang/String; in class Lcom/google/firebase/FirebaseApp; or its super classes (declaration of 'com.google.firebase.FirebaseApp' appears in /data/app/com.example.dell.step-0EFkj52NpZr3iw4rjYmqKQ==/split_lib_dependencies_apk.apk) – Saba Nayab Apr 09 '19 at 18:49
  • i tired this but it did help "https://stackoverflow.com/questions/51336198/no-virtual-method-zzbqoz-in-class-lcom-google-firebase-firebaseapp-or-its-sup" – Saba Nayab Apr 09 '19 at 18:50
  • In that case, please share the entire content of your both build.gradle files. – Alex Mamo Apr 09 '19 at 18:51
  • Don't mix versions, just use the one in my answer. – Alex Mamo Apr 09 '19 at 18:51
  • So please share the entire content of your both build.gradle files, as asked before. – Alex Mamo Apr 09 '19 at 20:39