android studio 64k问题

之前项目一直报64k问题,分割之后还是报一些json处理问题,自己记录一下解决方法,当然这是看的别的文章之后才好的,感谢那几位道友,不过具体链接忘记了。自己也小白,不解释。

1.

defaultConfig {
    applicationId ""
    minSdkVersion 15
    targetSdkVersion 19
    multiDexEnabled true  //
}
2.

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    ……
    compile 'com.android.support:multidex:1.0.0'  //
}

3.

dexOptions {
    javaMaxHeapSize "2g" //
}

4.library中idk版本与项目保持一致

5.

public class WangQiuApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
    }
    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);  //
    }
}

猜你喜欢

转载自blog.csdn.net/qq_34475640/article/details/70249836