johncurtis32
johncurtis32

Reputation: 49

MuliDex class cannot be resolved

Good day to all the geniuses out there. I need help solving my apps 64k limit. I did everything according to the book.I added these lines in my app build.gradle file

 defaultConfig {
    applicationId "com.ihive.quintesentialtechs.activity"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true;
}

and then added a multidex aar module dependency

compile project(':multidex-1.0.1')

I then went on to override the attachBaseContext method like so

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

by the way my App class extends Application not MultiDexApplication and in my manifest i did this

<application
    android:name="com.ihive.quintesentialtechs.application.App"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

So the problem is that in my app class the MultiDex class cannot be resolved, I tried to invalidate and restart the caches nothing works! please please someone help me. thanks in advance.

Upvotes: 0

Views: 485

Answers (2)

Aliyu Abdullahi
Aliyu Abdullahi

Reputation: 129

If after adding the dependency, the error still persist, try restarting android studio, if same error, delete the .gradle folder of the project and build again. let the app download all dependencies from scratch again. hope this help.

Upvotes: 1

Farhad
Farhad

Reputation: 12976

You should also add compile 'com.android.support:multidex:1.0.0' to the build.gradle file, in the dependencies section.

Upvotes: 0

Related Questions