Android 65536问题

Android Studio解决办法

android {

    compileSdkVersion 21
    buildToolsVersion '21.1.0'

    defaultConfig {
       ...
       targetSdkVersion 21
       multiDexEnabled true // 多dex解决65536问题
   }
}

虽然解决了65536问题,但是还会有

Execution failed for task ':app:transformClassesWithDexForDebug'.

的问题,这是由于项目太大,JVM heap值不够造成的,解决办法:

android {
//snip
//add this into your existing 'android' block
    dexOptions {
        javaMaxHeapSize "4g"
    }
//snip
}

转自:https://metova.com/blog/dev/overhead-limit-exceeded/

 

posted on 2016-03-23 01:09  a0000  阅读(238)  评论(0编辑  收藏  举报

导航