Unable to update the Firebase dependency(com.google.firebase)

后端 未结 5 835
灰色年华
灰色年华 2020-12-20 15:36

I have Added Firebase to android app for push notification. I have updated build.gradle before i have used. Its working fine.

 compile \'com.google.firebase:         


        
5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-20 16:42

    Add the google-services plugin

    In build.gradle file, to include the google-services plugin:

    buildscript {
    // ...
    dependencies {
        // ...
        classpath 'com.google.gms:google-services:3.0.0'
    }
    }
    

    Then, in your module Gradle file (usually the app/build.gradle), add the apply plugin line at the bottom of the file to enable the Gradle plugin:

    apply plugin: 'com.android.application'
    
    android {
    // ...
     }
    
    dependencies {
     // ...
    compile 'com.google.firebase:firebase-core:10.0.1'
    
    // Getting a "Could not find" error? Make sure you have
    // the latest Google Repository in the Android SDK manager
     }
    
    // ADD THIS AT THE BOTTOM
    apply plugin: 'com.google.gms.google-services'
    

    More details refer Firebase setup

提交回复
热议问题