美文网首页
解决 AndroidStudio 打包时出现 too many

解决 AndroidStudio 打包时出现 too many

作者: 吴_永健 | 来源:发表于2017-08-09 16:31 被阅读0次
    image.png

    打包时遇到这个问题,查找了很多解决方案都未能解决。最终找到了一个方案结束了我漫长的英文阅读之路。这里分享一下。
    在 build.gradle 中进行如下配置。

     dexOptions {
            incremental true
            javaMaxHeapSize "4g"
            keepRuntimeAnnotatedClasses false
        }
    

    出处:https://stackoverflow.com/questions/32721083/too-many-classes-in-main-dex-list-main-dex-capacity-exceeded
    另外,方法数超过 64k 可以参考官方提供的解决方案:
    https://developer.android.com/studio/build/multidex.html

    相关文章

      网友评论

          本文标题:解决 AndroidStudio 打包时出现 too many

          本文链接:https://www.haomeiwen.com/subject/rqrqrxtx.html