Android app does not connect to Firebase

前端 未结 21 1859
太阳男子
太阳男子 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:01

    Go to the app build.gradle file. Replace 'compile' with 'api'. Then, sync your project. The warning should go away. This worked fine for me.

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

    In the Gradle file:

    apply plugin: 'com.google.gms.google-services'
    

    This helped me.

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

    I had same problem. I solved it by updating the sha-1 code to firebase console and re-importing google-json file from firebase. The main problem I found that after updating the android studio the sha-1 or md5 code has changed.

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

    in my case in my manifest remove node

     <application
            android:name=".controller.AppController"
            android:allowBackup="false"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:usesCleartextTraffic="true"
            android:roundIcon="@mipmap/ic_launcher"
            android:supportsRtl="true"
            tools:node="replace"
            android:theme="@style/AppTheme">
    

    remove this line

     tools:node="replace"
    

    and replace with this

    tools:replace="allowBackup"
    
    0 讨论(0)
  • 2020-12-13 18:05

    Watch out if you are using:

    android.enableR8 = true

    Just remove it for the moment. That was the error for me.

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

    I had some other error in build.gradle file. After commenting out below line, it started working :

    dexOptions
                {
                    //incremental false
                }
    
    0 讨论(0)
提交回复
热议问题