2017-02-28 71 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的信息。