java.lang.NoSuchMethodError: No virtual method setTokenProvider

前端 未结 1 1666
挽巷
挽巷 2020-12-17 14:45

Below error occurs whenever i add com.google.firebase:firebase-firestore:19.0.0 to the Gradle and run the app.

E/AndroidRuntime: FATAL EXCEPTION         


        
1条回答
  •  有刺的猬
    2020-12-17 15:42

    Since you are using the latest version of firestore then, you need to add the following dependency to your build.gradle:

    implementation 'com.google.firebase:firebase-auth:17.0.0'
    

    According to the docs:

    Authentication version 17.0.0

    This update of firebase-auth is required to use new versions of firebase-firestore, firebase-functions, firebase-storage, and firebase-database going forward.

    Also since firebase-ui-auth uses version 16.0.5 of firebase auth then adding your own firebase-auth implementation which will override that version.


    So you should have the following dependencies:

    dependencies {
     implementation fileTree(dir: 'libs', include: ['*.jar'])
     implementation 'androidx.appcompat:appcompat:1.1.0-alpha03'
     implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
     testImplementation 'junit:junit:4.12'
     androidTestImplementation 'androidx.test:runner:1.1.0'
     androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
    
     implementation 'com.google.firebase:firebase-auth:17.0.0'
     implementation 'com.firebaseui:firebase-ui-auth:4.3.1'
    
    
    
     implementation 'com.facebook.android:facebook-android-sdk:5.0.0'
    
     implementation 'com.twitter.sdk.android:twitter-core:3.3.0'
     implementation 'androidx.recyclerview:recyclerview:1.0.0'
    
     implementation 'com.github.yalantis:ucrop:2.2.3-native'
    
     def camerax_version = "1.0.0-alpha01"
     implementation "androidx.camera:camera-core:${camerax_version}"
     implementation "androidx.camera:camera-camera2:${camerax_version}"
    
     implementation 'de.hdodenhof:circleimageview:3.0.0'
     implementation 'com.google.firebase:firebase-firestore:19.0.0'
    
    
    }
    

    0 讨论(0)
提交回复
热议问题