Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add firebase-admin to my android project?

Why when I try to add firebase-admin into my android project, the gradle tells me that "Version 5.5.0 is lower than the minimum version (9.0.0) required for google-services plugin" But version 5.5.0 of firebase-admin it's latest at this moment. WTH?

build.gradle

    dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.github.bumptech.glide:glide:4.3.1'
    compile 'com.github.GrenderG:Toasty:1.2.5'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'
    compile group: 'com.google.firebase', name: 'firebase-admin', version: '5.5.0'
    compile 'com.google.firebase:firebase-core:11.6.2'
    compile 'com.google.firebase:firebase-database:11.6.2'
    compile 'com.google.firebase:firebase-auth:11.6.2'
    compile 'com.google.android.gms:play-services-auth:11.6.2'
    implementation 'com.google.firebase:firebase-storage:11.6.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

apply plugin: 'com.google.gms.google-services'
like image 747
overkektus Avatar asked Nov 30 '17 19:11

overkektus


1 Answers

firebase-admin is not intended for use in Android apps. It's for accessing Firebase services from servers your control.

From the documentation regarding prequisites:

  • Make sure that you have a server app.
  • Make sure that your server runs the following depending on which Admin SDK that you use:
    • Admin Node.js SDK — Node.js 8.13.0+
    • Admin Java SDK — Java 7+ (recommend Java 8+)
    • Java 7 support is deprecated.
    • Admin Python SDK — Python 3.5+
    • Admin Go SDK — Go 1.9+ Admin .NET SDK — .NET Framework 4.5+ or .Net Core 1.5+

The google-services plugin is giving you that warning because it thinks every maven target with group "com.google.firebase" is actually a Firebase Android client SDK, which all must be the same version in your app.

like image 154
Doug Stevenson Avatar answered Oct 08 '22 06:10

Doug Stevenson