简体   繁体   English

无法将 Admin SDK 同步到 Build.Gradle 文件

[英]Could not sync Admin SDK to the Build.Gradle file

I have spent around 1 day learning the features of Admin SDK and found out that that API will help me a lot for managing users in the database but when I added to my project Build.Gradle file.我花了大约 1 天时间学习了 Admin SDK 的功能,并发现该 API 对管理数据库中的用户有很大帮助,但是当我添加到我的项目 Build.Gradle 文件时。 it shows this error:它显示此错误:

"could not find method implementation() for arguments [com.google.firebase:firebase-admin:6.6.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler." “无法在 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 类型的对象上找到参数 [com.google.firebase:firebase-admin:6.6.0] 的方法 implementation()。”

错误截图

put your implementation xxx to your app level build.gradle , NOT the TOP Level one.将您的implementation xxx放在您的应用程序级别build.gradle ,而不是顶级一级。

Eg under app/build.gradle例如在app/build.gradle

dependencies {
    // here 
    implementation 'com.google.firebase:firebase-admin:6.6.0'
    implementation ('com.google.firebase:firebase-messaging:9.6.1'){
        exclude module: 'firebase-common'
    }
    implementation ('com.google.firebase:firebase-auth:9.6.1'){
        exclude module: 'firebase-common'
    }
    implementation ('com.google.firebase:firebase-database:9.6.1'){
        exclude module: 'firebase-common'
    }
    implementation ('com.firebase:firebase-client-android:2.5.0'){
        exclude module: 'firebase-common'
    }

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM