以上是我根据需求添加的依赖项。
以下是我正在使用的google play服务依赖项。-实现的com。谷歌。Androidgms:播放服务:12.0.1'
我还在结束应用插件中添加了“应用插件”语句:“com.google.gms.google服务”
请帮我解决这个错误!
您是否正在构建中导入google服务。gradle(根级别)?
build.gradle
根级别
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
}
}
allprojects {
// ...
repositories {
// ...
google() // Google's Maven repository
}
}
build.gradle
应用程序级别
apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
implementation 'com.google.android.gms:play-services:12.0.1'
// ...
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-invites:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-crash:16.0.1'
// Getting a "Could not find" error? Make sure you have
// added the Google maven respository to your root build.gradle
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'