java.lang.NoClassDefFoundError: okhttp3.internal.Util

旧城冷巷雨未停 提交于 2019-11-28 13:08:47

You have enabled "multiDexEnabled true" and most probably you are not installing it in Application class.

This is how you should do

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0"

         defaultConfig {
             minSdkVersion 14 //lower than 14 doesn't support multidex
             targetSdkVersion 22

             // Enabling multidex support.
             multiDexEnabled true       //You have already did this 
         }
}


dependencies {
    compile 'com.android.support:multidex:1.0.1'   // add this in  dependencies
}

And finally extend the application

public class YouApplication extends Application {

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

}

And this is a good guide https://developer.android.com/studio/build/multidex.html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!