I have this problem when compiling my DEBUG app on 4.4, on 8.1 it works perfectly.
I have read many questions about this error but it does not solve the problem, I do not know what to do, my version of Android Studio is 3.5, so it does not have Instant Run
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.app-2.apk"],nativeLibraryDirectories =[/data/app-lib/com.app-2, /vendor/lib, /system/lib]]
This is my gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.app"
minSdkVersion 17
targetSdkVersion 28
versionCode 35
versionName "4.3"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//google
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
//firebase
implementation 'com.google.firebase:firebase-ads:18.2.0'
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-auth:19.1.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
//otras
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
implementation 'com.anjlab.android.iab.v3:library:1.0.44'
implementation 'com.yarolegovich:discrete-scrollview:1.4.7'
implementation 'com.github.siyamed:android-shape-imageview:0.9.3'
implementation 'com.mikhaellopez:circularprogressbar:1.1.1'
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'com.android.support:multidex:1.0.3'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
AndroidManifest:
<application
android:name=".utilidades.MyApplication"
MyApplication
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
MultiDex.install(this);
}
}
Implement the method
attachBaseContext()
and there initialize the multidex mode