第一步:
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 }