I am creating a simple chat application. In which i am using Google Cloud Message(GCM). but when I add google play service and plugin: 'com.google.gms.google-services'. it gives error
File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it. Information:BUILD FAILED Information:Total time: 2.942 secs Information:1 error Information:0 warnings Information:See complete output in console
but I try to add google-services.json in app root.and i did not get any solution to add in app root.
build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.dhananjay.chatserver"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.mcxiaoke.volley:library:1.0.6@aar'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
}
apply plugin: 'com.google.gms.google-services'
build.gradle(Project:XXXXX)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:2.0.0-alpha6'
// 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
}