4
votes

A/zygote: java_vm_ext.cc:534] JNI DETECTED ERROR IN APPLICATION: JNI GetStaticMethodID called with pending exception java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.ContextCompat" on path: DexPathList[[zip file "/data/app/packagename-fNlt_Hyr4Uv4lFVItkfrgg==/base.apk"],nativeLibraryDirectories=[/data/app/packagename-fNlt_Hyr4Uv4lFVItkfrgg==/lib/arm, /data/app/packagename-fNlt_Hyr4Uv4lFVItkfrgg==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]

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

    }
2

2 Answers

1
votes

I've just solved an issue involving android.support.v4.content.ContextCompat by importing the following library instead:

import androidx.core.content.ContextCompat;

0
votes

If you didn't add below dependency, please add it in build.gradle(Module:app)

dependencies {
//other dependencies
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
}

To know equivalent for new Androidx Artifacts from old build artifacts, please refer the below link

https://developer.android.com/jetpack/androidx/migrate/artifact-mappings