集成GCM后构建项目失败

时间:2015-06-10 10:22:01

标签: java android google-cloud-messaging

我只是想在我的应用上添加GCM,然后我跟着documentation。将 classpath' com.google.gms:google-services:1.3.0-beta1' 此行添加到顶级类路径后,我无法构建项目并显示构建终端错误错误

顶级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"
    }
 }
  

任务执行失败&#39;:myModule:processDebugResources&#39;。   com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:

要获得终端的更多输出,请参阅here 任何帮助! , 谢谢。

1 个答案:

答案 0 :(得分:1)

File-> Project structure -> "module" -> Dependencies -> + -> Library dependency并从那里选择GCM。