报错log: Error:The number of method references in a .dex file cannot exceed 64K. Learn how to resolve this issue at 
  https://developer.android.com/tools/building/multidex.html

原因: 这应该是方法数量超过了65535导致的,这是google的一个限制,不知道为何要这么做,出现这个错误就是要求你分包。每个apk都有一个dex文件,引用的lib包过多,或其他方式会导致这个问题,所以google支持多个dex文件配置,也就是分包
  解决办法:
  1. 在app/build.gradle里面添加
  defaultConfig {
...
        // Enabling multidex support.
multiDexEnabled true
      }
  2. 同?在app/build.gradle里面添加:
 dependencies {
    ...
compile 'com.android.support:multidex:1.0.0' //根据版本支持来配置,目前支持1.0.1
     }
 
  3. 自己新建一Application类,继承MultiDexApplication, 具体如下:
 public class MyApplication extends MultiDexApplication {

protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
      }
}
  4. 在AndroidManifest.xml里面配置application, 如下:
     <application
            .....
            android:name="com.idt.escooter.app.MyApplication">
.....
</application>
重新rebuild, 运行.

Android studio: The number of method references in a .dex file cannot exceed 64K. Learn how to resol相关推荐

  1. 方法超出 android,Android工程方法数超过64k,The number of method references in a .dex file cannot exceed 64K....

    最近将一个老的Eclipse项目转到Android Studio后,用gradle添加了几个依赖,项目可以make,但是一旦run就报错 Error:The number of method refe ...

  2. AndroidStudio:The number of method references in a .dex file cannot exceed 64K错误

    在AndroidStudio中出现下面的错误提示: Error:The number of method references in a .dex file cannot exceed 64K. Le ...

  3. Android开发 Error(建议收藏下来以备不时之需):The number of method references in a .dex file cannot exceed 64K.

    前言 我一直都知道app里面的方法数是有限制的差不多64000,具体的就未曾考证了 在遇到这个问题之前,一直以为这个一个多么遥远的距离 其实并不是的,稍有不慎这个异常出来了 当前并不是你真的有编写了6 ...

  4. The number of method references in a .dex file cannot exceed 64K. Error 解决方案

    我们都知道app里面的方法数是有限制的差不多64000个,具体就为曾考证了 在遇到这个问题之前,一直以为这是一件多么遥远的事情,其实并不是的,稍有不慎这个异常出来了 也有可能并不是你真的有编写了64k ...

  5. 解决The number of method references in a .dex file cannot exceed 64K的问题

    需要分包build只需要 在build.gradle defaultConfig中加入 multiDexEnabled true defaultConfig {multiDexEnabled true ...

  6. 如何处理 android 方法总数超过 65536 . the number of method references in a .dex file exceed 64k

    一:问题描述:     应用中的Dex 文件方法数超过了最大值65536的上限,简单来说,应用爆棚了. 二.解决方案:      方案1:使用插件化框架  比如: https://github.com ...

  7. Android Studio提示No virtual method asBitmap()Lcom/bumptech/glide/RequestBuilder

    1 问题 android studio导入别人项目的module,运行点击app,程序奔溃,错误日志如下 Process: com.example.chenyu, PID: 6302java.lang ...

  8. 【错误记录】Android Studio 配置 AspectJ 报错 ( Failed to create Jar file C:\xxx\aspectjtools-1.8.10.jar. )

    文章目录 一.报错信息 二.解决方案 三.Gradle 与 Gradle 插件版本适配 一.报错信息 在 Android Studio 中配置 AspectJ , 配置后的 Module 下的 bui ...

  9. Android Studio Linking an external C++ project 时候 报Invalid file name. Expected: CMakeLists.txt

    Android Studio 右键Linking an external C++ project 时候 报Invalid file name. Expected: CMakeLists.txt错误 查 ...

最新文章

  1. 邮件服务器SMTP概述
  2. 图片尺寸对分类迭代次数和准确率的影响
  3. AVCDecoderConfiguration语法格式分析
  4. [转载] 用Java语言实现对十六进制字符串异或运算
  5. Spring Boot笔记-@ComponentScan初步解析
  6. java 企业级应用设计规范_一步一步理解Java 企业级应用的可扩展性
  7. 异常:Software caused connection abort: socket write error
  8. 【CCCC】L3-010 是否完全二叉搜索树 (30分),完全二叉树判断+层次遍历(奇怪的方法)
  9. 配置Hadoop开发环境(Eclipse)
  10. 计算机学院军训条幅,最新各大高校欢迎新生横幅,确认过眼神,师兄师姐Skr人才。...
  11. 判断是否是空对象_3分钟短文 | Laravel 查询结果检查是不是空,5个方法你别用错...
  12. python没有pygame_Python菜鸟快乐游戏编程_pygame
  13. 《老路用得上的商学课》81-85学习笔记
  14. java实现PC网站实现微信扫码登陆
  15. android扫描文件,安卓手机怎么扫描文件_手机扫描文件的图文教程-系统城
  16. Uboot 使用串口Kermit协议传输文件
  17. 3208点阵时钟c语言程序,点阵万年历(带时间、年月日星期调整及闹钟功能)C程序...
  18. 入侵91网直到拿下服务器#并泄露150w+用户信息
  19. 2016全球大数据战略版图剖析(6):应用篇下
  20. linux下使用find命令全局查找文件

热门文章

  1. backup archivelog all not backed up;
  2. 设计模式之设配器模式
  3. 双语美文|治愈系英文段子,你对人生过敏吗
  4. 声纹技术(七):声纹技术的未来
  5. AI 边缘计算平台 - BeagleBone AI 64 简介
  6. 银行流失用户分析及预测模型
  7. 查看本地IP和服务器端口
  8. 标题EMC干货之共模干扰 转载
  9. Java 简易五子棋游戏的编写
  10. flutter 图形验证码