我正在使用Android Studio 1.2.2。我已经集成了Maps 4 Work SDK,但此后构建失败了。我们在项目中使用Google Play服务库(仅使用com.google.android.gms.tagmanager.*)。现在,在集成googlemaps_sdk_m4b_lib后,无法生成构建。在此之前,尝试只包含google_play_services_lib的tagmanager部分,但这不是一个可用的依赖项。构建失败,错误信息如下:
:n农民们:dexDebug AGPBI: {"kind":"SIMPLE","text":"意外的顶级错误:","position":{},"original":"UNEXPECTED TOP-LEVEL ERROR:"} AGPBI: {"kind":"SIMPLE","text":"java.lang.OutOfMemoryError: GC超时限制已超过","position":{},"original":"java.lang.OutOfMemoryError: GC overhead limit exceeded"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.cst.ConstantPoolParser.parseUtf8(ConstantPoolParser.java:371)","position":{},"original":"\tat com.android.dx.cf.cst.ConstantPoolParser.parseUtf8(ConstantPoolParser.java:371)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:262)","position":{},"original":"\tat com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:262)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.cst.ConstantPoolParser.parse(ConstantPoolParser.java:150)","position":{},"original":"\tat com.android.dx.cf.cst.ConstantPoolParser.parse(ConstantPoolParser.java:150)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.cst.ConstantPoolParser.parseIfNecessary(ConstantPoolParser.java:124)","position":{},"original":"\tat com.android.dx.cf.cst.ConstantPoolParser.parseIfNecessary(ConstantPoolParser.java:124)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.cst.ConstantPoolParser.getPool(ConstantPoolParser.java:115)","position":{},"original":"\tat com.android.dx.cf.cst.ConstantPoolParser.getPool(ConstantPoolParser.java:115)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:482)","position":{},"original":"\tat com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:482)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)","position":{},"original":"\tat com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)","position":{},"original":"\tat com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)","position":{},"original":"\tat com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.command.dexer.Main.parseClass(Main.java:764)","position":{},"original":"\tat com.android.dx.command.dexer.Main.parseClass(Main.java:764)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.command.dexer.Main.access$1500(Main.java:85)","position":{},"original":"\tat com.android.dx.command.dexer.Main.access$1500(Main.java:85)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)","position":{},"original":"\tat com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.command.dexer.Main.processClass(Main.java:749)","position":{},"original":"\tat com.android.dx.command.dexer.Main.processClass(Main.java:749)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)","position":{},"original":"\tat com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.command.dexer.Main.access$1200(Main.java:85)","position":{},"original":"\tat com.android.dx.command.dexer.Main.access$1200(Main.java:85)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)","position":{},"original":"\tat com.android.dx.command
:n农民们:dexDebug AGPBI: {"kind":"SIMPLE","text":"意外的顶级错误:","position":{},"original":"UNEXPECTED TOP-LEVEL ERROR:"} AGPBI: {"kind":"SIMPLE","text":"java.lang.OutOfMemoryError: GC超时限制已超过","position":{},"original":"java.lang.OutOfMemoryError: GC overhead limit exceeded"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.cst.ConstantPoolParser.parseUtf8(ConstantPoolParser.java:371)","position":{},"original":"\tat com.android.dx.cf.cst.ConstantPoolParser.parseUtf8(ConstantPoolParser.java:371)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:262)","position":{},"original":"\tat com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:262)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.cst.ConstantPoolParser.parse(ConstantPoolParser.java:150)","position":{},"original":"\tat com.android.dx.cf.cst.ConstantPoolParser.parse(ConstantPoolParser.java:150)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.cst.ConstantPoolParser.parseIfNecessary(ConstantPoolParser.java:124)","position":{},"original":"\tat com.android.dx.cf.cst.ConstantPoolParser.parseIfNecessary(ConstantPoolParser.java:124)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.cst.ConstantPoolParser.getPool(ConstantPoolParser.java:115)","position":{},"original":"\tat com.android.dx.cf.cst.ConstantPoolParser.getPool(ConstantPoolParser.java:115)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:482)","position":{},"original":"\tat com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:482)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)","position":{},"original":"\tat com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)","position":{},"original":"\tat com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)","position":{},"original":"\tat com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.command.dexer.Main.parseClass(Main.java:764)","position":{},"original":"\tat com.android.dx.command.dexer.Main.parseClass(Main.java:764)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.command.dexer.Main.access$1500(Main.java:85)","position":{},"original":"\tat com.android.dx.command.dexer.Main.access$1500(Main.java:85)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)","position":{},"original":"\tat com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.command.dexer.Main.processClass(Main.java:749)","position":{},"original":"\tat com.android.dx.command.dexer.Main.processClass(Main.java:749)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)","position":{},"original":"\tat com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.command.dexer.Main.access$1200(Main.java:85)","position":{},"original":"\tat com.android.dx.command.dexer.Main.access$1200(Main.java:85)"} AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)","position":{},"original":"\tat com.android.dx.command
失败
错误:构建过程中发生异常。
出现了什么问题: 任务':nFarmers:dexDebug'执行失败。
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: 进程“command '/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/bin/java'”以非零退出值3结束
尝试: 使用--stacktrace选项运行以获取堆栈跟踪。 使用--info或--debug选项运行以获取更多日志输出。
构建失败
总时间:1分24.059秒
我的应用程序的build.gradle文件
apply plugin: 'android'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:multidex:1.0.0'
compile project(':Marketing')
compile project(':android-pdfview')
compile project(':Volley')
compile project(':googlemaps_sdk_m4b_lib')
compile 'com.google.android.gms:play-services:7.5.0'
}
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc2"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
jniLibs.srcDirs = ['jniLibs']
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 {
minSdkVersion 16
targetSdkVersion 22
// Enabling multidex support.
multiDexEnabled true
}
buildTypes {
debug {
multiDexKeepFile file('main-dex-list.txt')
debuggable true
proguardFile '/Users/path/to/proguard-project.txt'
}
release {
multiDexKeepFile file('main-dex-list.txt')
}
}
productFlavors {
}
dexOptions {
}
aaptOptions {
useNewCruncher true
}
configurations{
all*.exclude group: 'com.android.support', module:'multidex'
all*.exclude group: 'com.android.support', module: 'support-v4'
}
}