Firebase 管理 sdk 未与 gradle 同步 [英] Firebase admin sdk not syncing with the gradle

查看:24
本文介绍了Firebase 管理 sdk 未与 gradle 同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将一些库合并到我的 android 应用程序中.我已将其与 Firebase 云服务器连接.现在,我想为用户身份验证创建令牌.Firebase 要求将 Firebase Admin Sdk 添加到 gradle 文件.但是,它在构建 gradle 时显示错误.我添加的 sdk 是 compile 'com.google.firebase:firebase-admin:5.3.1'

I have incorporated some libraries into my android app. I have connected it with Firebase cloud server. Now, I want to create tokens for User authentication. Firebase asks to add Firebase Admin Sdk to the gradle File. However, it shows error on building the gradle. The sdk I am adding is compile 'com.google.firebase:firebase-admin:5.3.1'

以下是错误:

错误:与依赖项 'com.google.code.findbugs:jsr305' 发生​​冲突项目:应用程序".应用程序 (3.0.0) 和测试应用程序 (2.0.1) 的已解决版本不同.请参阅 http://g.co/androidstudio/app-test-app-conflict对于详情.

Error:Conflict with dependency 'com.google.code.findbugs:jsr305' in project ':app'. Resolved versions for app (3.0.0) and test app (2.0.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.

我的原始代码是:

apply plugin: com.android.application

android {

compileSdkVersion 25

buildToolsVersion "25.0.2"

defaultConfig {

    applicationId "com.example.delluser.oshoguide"

    minSdkVersion 17

    targetSdkVersion 25

    versionCode 1

    versionName "1.0"

    testInstrumentationRunner

 "android.support.test.runner.AndroidJUnitRunner"

}
buildTypes {

    release {

        minifyEnabled false

        proguardFiles getDefaultProguardFile('proguard-android.txt'),

 'proguard-rules.pro'
    }
}

packagingOptions
        {

            exclude 'META-INF/notice'
            exclude 'META-INF/notice.txt'
            exclude 'META-INF/license'
            exclude 'META-INF/license.txt'
        }

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',{
    exclude group: 'com.android.support', module: 'support-annotations'
})

compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-crash:11.0.1'
compile 'com.google.firebase:firebase-auth:11.0.1'
compile 'com.google.firebase:firebase-database:11.0.1'
compile 'com.google.firebase:firebase-messaging:11.0.1'
compile 'com.google.firebase:firebase-storage:11.0.1'
compile 'com.firebase:firebase-client-android:2.3.1'
compile 'com.firebaseui:firebase-ui:0.6.2'
compile 'com.android.support:design:25.3.1'
compile 'com.google.firebase:firebase-admin:5.3.1'

testCompile 'junit:junit:4.12'
}


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

推荐答案

firebase-admin 不属于 Android 应用程序.它用于服务器端应用程序.如果您尝试将其添加到 Android 应用中,它肯定会与其他 Firebase 库发生冲突.

firebase-admin doesn't belong in an Android app. It's for server side applications. If you attempt to add it to an Android app, it will definitely collide with the other Firebase libraries.

如果您想创建自定义身份验证令牌,则必须在服务器上进行.请注意 Firebase Admin SDK 文档的标题:将 Firebase Admin SDK 添加到您的服务器.

If you want to mint custom auth tokens, you have to do that on a server. Please note the title of the Firebase Admin SDK docs: Add the Firebase Admin SDK to Your Server.

这篇关于Firebase 管理 sdk 未与 gradle 同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆