2017-02-28 35 views
-4

我感兴趣的是如何在android studio中使用谷歌地图。我跟着一个教程,我三重检查,一切都被正确输入,但是当我试图建立的APK,我得到这个错误:这个错误在android studio中意味着什么?

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536

+1

这意味着编译代码中有太多的方法。尝试使用DexIndexOverflowException进行互联网搜索...使用DexIndexOverflowException和谷歌播放服务的Internet搜索将返回更有趣的结果... – Selvin

回答

2

I was interested in how you can use google maps in android studio

使用此

compile 'com.google.android.gms:play-services-maps:10.2.0' 

,而不是这个

compile 'com.google.android.gms:play-services:10.2.0' 

如果你想MOR Ë谷歌播放服务不是只映射see here

如果你去那里,读

(重点煤矿)

If the number of method references in your app exceeds the 65K limit, your app may fail to compile. You may be able to mitigate this problem when compiling your app by specifying only the specific Google Play services APIs your app uses, instead of all of them

0

确保你只添加了谷歌播放你正在使用的服务的API。在你的情况,你只想要的地图,所以用这个:

com.google.android.gms:play-services-maps:10.2.0 

而不是增加全包的。第二个选项是启用多个dex。使用链接:https://developer.android.com/studio/build/multidex.html了解有关启用多重dex的信息。