问题描述
为什么当我尝试将firebase-admin添加到我的android项目中时,gradle告诉我版本5.5.0低于google-services插件所需的最低版本(9.0.0)但是版本5.5.0 firebase-admin是目前最新的。 WTH?
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
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'
推荐答案
firebase-admin不适用于Android应用。它用于从您的控件服务器访问Firebase服务。
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:
- If using the Admin Node.js SDK, a server running Node.js 4.0+
- If using the Admin Java SDK, a server running Java 7+
- If using the Admin Python SDK, a server running Python 2.7+ or 3.x
- A server app
google-services插件提供了这个警告,因为它认为每个使用groupcom.google.firebase的maven目标实际上都是一个Firebase Android客户端SDK,它们都必须与您的应用相同。
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.
这篇关于如何将firebase-admin添加到我的android项目中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!