Android studio 报Error:The number of method references in a .dex file cannot exceed 64K错误

第一步:

dependencies { ***

}

compile'com.android.support:multidex:1.+'


第二步:


defaultConfig {

multiDexEnabledtrue

}


第三步:


在 AndroidManifest.xml 中的  application 标签中添加    


<application
         ...
        android:name="android.support.multidex.MultiDexApplication">


提示:如果你的应用程序继承 Application , 那么你需要重写     

1 @Override
2     protected void attachBaseContext(Context base) {
3         super.attachBaseContext(base);
4         MultiDex.install(this) ;
5     }


猜你喜欢

转载自blog.csdn.net/a1003434346/article/details/71198316