2017-03-17 65 views
-1

我使用谷歌地图,它会产生一个错误....谷歌地图API提供了错误“应用程序:transformClassesWithDexForDebug”

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 

使用简单的地图活动,并嵌入我的API文,但它的工作原理。

+0

使用'在你的应用程序gradle这个(在defaultConfig)multiDexEnabled TRUE'。 – user392117

回答

0

使用下面的代码启用multidex:

android { 
    compileSdkVersion 22 
    buildToolsVersion "23.0.0" 

    defaultConfig { 
     minSdkVersion 14 //lower than 14 doesn't support multidex 
     targetSdkVersion 22 

     // Enabling multidex support. 
     multiDexEnabled true 
    } 
} 

dependencies { 
    compile 'com.android.support:multidex:1.0.1' 
}