gpt4 book ai didi

java - 集成 GCM 后构建项目失败

转载 作者:行者123 更新时间:2023-11-30 11:02:29 26 4
gpt4 key购买 nike

我只是想在我的应用程序上添加 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'
}
}

应用构建.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:

更多终端输出,请查看here .
任何帮助! , 谢谢。

最佳答案

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

关于java - 集成 GCM 后构建项目失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30753552/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com