I am simply trying to add GCM on my app and I followed the documentation . After adding classpath 'com.google.gms:google-services:1.3.0-beta1' this line to top level class path , I can not build the project and it shows build failed error in terminal
Top level build.gradle
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'com.google.gms:google-services:1.3.0-beta1'
}
}
App build.gradle
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':SocialArticleFramework')
compile project(':android-support-v7-appcompat')
compile 'com.android.support:multidex:1.0.0'
compile "org.igniterealtime.smack:smack-android:4.1.0"
compile "org.igniterealtime.smack:smack-android-extensions:4.1.0"
compile "org.igniterealtime.smack:smack-sasl-provided:4.1.0"
compile "org.igniterealtime.smack:smack-tcp:4.1.0"
compile "org.igniterealtime.smack:smack-im:4.1.0"
compile 'com.diegocarloslima:fgelv:0.1.+@aar'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'in.srain.cube:ultra-ptr:1.0.9'
compile 'com.google.code.gson:gson:2.3'
compile 'org.apmem.tools:layouts:1.9@aar'
compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
compile 'se.emilsjolander:StickyScrollViewItems:1.1.0'
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
defaultConfig {
multiDexEnabled = true
}
dexOptions {
preDexLibraries = false
incremental true
javaMaxHeapSize "4g"
}
}
Execution failed for task ':myModule:processDebugResources'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException:
For more output in terminal , pls see here.
Any help! , thanks.
File-> Project structure -> "module" -> Dependencies -> + -> Library dependency
and select GCM from there.