方法数超过64k报65536解决

参考文章链接

 http://blog.163.com/qqoowww@yeah/blog/static/17309394720164261124405/ 

方法数超过64k   65536


在build.gradle中defaultConfig中开启

 // Enabling multidex support.
        multiDexEnabled true

导依赖

//65536   修改项目的 build.gradle 文件启用 MultiDex 并包含 MultiDex 库:
    compile 'com.android.support:multidex:1.0.0'

继承application    记着去注册

重写方法

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }

    @Override
    public void onCreate() {
        super.onCreate();
    }


也可以继承 MultiDexApplication  



你可能感兴趣的:(方法数超过64k报65536解决)