Cannot resolve MultiDexApplication after updating android studio 4.0

Viewed 113

After updating android studio to 4.0 and gradle to 6.1.1. There are some issues in my project which can't resolve.

import androidx.multidex.MultiDexApplication

and

public class MyApplication extends MultiDexApplication

I have this lib in my project and using it works fine on previous version of Android studio.

2 Answers

Try the following things.

  1. Check whether your multidex dependency version in grade is updated one.
  2. Delete your build folder in your project.
  3. Clean project then Make Project.
  4. If its still showing error then Invalidate cache and restart.

Hope this resolves your issue.

Do you use MultidexApplication in a module that does not have multidex library dependency?

In you module build.gradle file:

dependencies {
    implementation 'androidx.multidex:multidex:2.0.1'
}

Before gradle 6.1.1, you could use MultidexApplication in a library module and only have multidex dependency in the application module that depends on it. After the update, you need to have multidex depdency in your library module as well.

Related