Default FirebaseApp is not initialized in this process. Make sure to call FirebaseApp.initializeApp(Context) first

前端 未结 4 1001
星月不相逢
星月不相逢 2021-02-07 16:11

Default FirebaseApp is not initialized in this process. Make sure to call FirebaseApp.initializeApp(Context) first.

i have tried with many things but i am not able to Ge

相关标签:
4条回答
  • 2021-02-07 16:18

    Upgrade com.google.gms:google-services to latest version, it will be solved.

    0 讨论(0)
  • 2021-02-07 16:19

    Make sure:

    1. Package name in AndroidManifest.xml is identical to one in the google-services.json
    2. google-services.json build action is set to GoogleServicesJson
    3. After step 2 restart your IDE & clean & rebuild
    4. Explicitly call FirebaseApp.InitializeApp(Application.Context); in MainActivity.OnCreate just before the LoadApplication(..)
    0 讨论(0)
  • 2021-02-07 16:21

    Add the plugin to the build.gradle (app level)

    // ADD THIS AT THE BOTTOM

    apply plugin: 'com.google.gms.google-services'
    
    0 讨论(0)
  • 2021-02-07 16:37

    For me, none of the solutions worked that were given anywhere. Only this worked. Just had to downgrade my google services from 4.1.0 to 4.0.0

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0-alpha08'
        classpath 'com.google.gms:google-services:4.0.0'
        /*classpath 'com.google.gms:google-services:4.1.0' <-- this was the problem */
    }
    

    So if you have updated the google services, just try to downgrade or change to an older version. Hope it helps

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