Android app does not connect to Firebase

前端 未结 21 1860
太阳男子
太阳男子 2020-12-13 17:50

I\'m developing android app using Firebase GMS service.
I tried to follow their tutorials, i made project as they said, downloaded the json files.

But when I

相关标签:
21条回答
  • 2020-12-13 18:22

    in build.gradle (Module.app) if you use view binding, comment it temporarily, then sync!

    /*
    viewBinding {
       enabled = true
    }
    */
    

    then connect to firebase. I use AS 4.0. please rate up if this help you, thanks!

    0 讨论(0)
  • 2020-12-13 18:23

    I had the exact same issue. I built successfully but got the same message when hitting the 'Connect to Firebase' button via Assistant.

    It turned out that I had a warning that I had to fix to get it to work.

    "Configuration on demand is an incubating feature. WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html"

    I just had to replace my 'compile's with 'api' and then it worked. I'd suggest looking into fixing warnings if you have any even though your build is successful.

    0 讨论(0)
  • 2020-12-13 18:23

    In my case, it was shown this warning:

    API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()
    

    because of that I could not connect to firebase.

    caused from gms services 4.3.0. So i had to change it to:

    com.google.gms:google-services:4.2.0

    I have found this by running:

    gradlew sync -Pandroid.debug.obsoleteApi=true

    in terminal. Go to view -> tool windows -> Terminal in Android Studio. Gms services will probably fix this in the future versions.

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