关于Android文件数过大,分包问题的解决办法

913 阅读1分钟

用MultiDex分包

  • 1.在AppLication里进行注册
public class App extends BaseApplication {

    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        //MultiDex分包
        MultiDex.install(this);
    }
}
  • 2.在Build注入
dependencies {

    compile 'com.android.support:multidex:1.0.1'
}
  • 大功告成 如果项目还不可以,直接rebuild project一下。clean一下项目,运行,一切正常

欢迎下方留言评论

如果对您有一些微薄的帮助,可以点赞👍