我是android developnment的新手。我正在尝试在我的应用程序中集成firebase云消息通知服务。根据https://firebase.google.com/中提到的指南,我在我的应用程序文件夹中添加了google-services.json文件,但我仍然收到此错误说“文件google-services .json缺少模块根...“。请帮帮我。 下面是我的Build.gradle(项目级别)文件: -
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Build.gradle(应用级别): -
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "mohit.munjal.firebasenotifications"
minSdkVersion 15
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'
}
}
}
dependencies {
compile 'com.google.android.gms:play-services:10.2.6'
compile 'com.google.firebase:firebase-messaging:10.2.6'
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'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
错误: -
Error:Execution failed for task ':app:processDebugGoogleServices'.> File
google-services.json is missing. The Google Services Plugin cannot
function without it.
Searched Location:
D:\Android studio projects\FirebaseCloudMessagingApp\app\src\debug\google-
services.json
D:\Android studio projects\FirebaseCloudMessagingApp\app\google-
services.json