Android studio 编译 The number of method references in a .dex file cannot exceed 64K.

出现这种情况的:工程在编译的时候方法超过dex最多储存范围65536,会抛出异常MultiDex。

解决方法:在 app 里面的build.gradle   android 加入   multiDexEnabled true

Android studio 编译 The number of method references in a .dex file cannot exceed 64K.

在
dependencies 加入   implementation 'com.android.support:multidex:1.0.1'