Android获得意外的顶级异常

时间:2015-09-14 08:48:47

标签: android google-maps

对于Android,我将google-maps-sdk-m4b(google maps api for work)添加到我的项目中

意外的顶级例外:

ava.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536
    at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:501)
    at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:282)
    at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:490)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:167)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
    at com.android.dx.command.dexer.Main.run(Main.java:230)
    at com.android.dx.command.dexer.Main.main(Main.java:199)
    at com.android.dx.command.Main.main(Main.java:103)

从阅读有关类似问题的其他帖子似乎表明我需要排除播放服务库,但我需要播放服务库才能让Google消息服务适用于该应用。根据谷歌文件

将应用程序迁移到Google Maps Mobile SDK for Work时,您无需从项目中删除Google Play服务SDK。但是,您应删除对com.google.android.gms.maps包的任何引用

这些是我的依赖

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/androidnetworking.jar')
compile project(':facebook')
compile 'com.android.support:support-v4:22.2.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:appcompat-v7:22.0.+'
compile 'com.nineoldandroids:library:2.4.0'
compile project(':library_pulltorefresh')
compile(name:'google-maps-sdk-m4b', ext:'aar')
}

我不确定为什么我会收到此错误,因为我需要保留这两个包。请有人帮忙。

1 个答案:

答案 0 :(得分:-1)

请更改依赖项,如下所示:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':facebook') // if possible use gradle here
compile 'com.android.support:support-v4:22.2.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:appcompat-v7:22.0.+'
compile 'com.nineoldandroids:library:2.4.0'
compile project(':library_pulltorefresh') // if possible use gradle here
compile(name:'google-maps-sdk-m4b', ext:'aar')
}

由于