首页 > 解决方案 > 在路径上找不到类“android.support.v4.content.ContextCompat”:DexPathList[[zip file“/system/framework/org.apache.http.legacy.boot.jar”

问题描述

当我升级Androidx时,我遇到了如下问题:

预计没有待处理的异常:java.lang.ClassNotFoundException:在路径上找不到类“android.support.v4.content.ContextCompat”:DexPathList [[zip 文件“/system/framework/org.apache.http.legacy.boot .jar", zip 文件 "/data/app/com.alpha.lagouapk-hKiBdzRnFfV_fBa3ll3GWg==/base.apk"],nativeLibraryDirectories=[/data/app/com.alpha.lagouapk-hKiBdzRnFfV_fBa3ll3GWg==/lib/arm, /data/app/com.alpha.lagouapk-hKiBdzRnFfV_fBa3ll3GWg==/base.apk!/lib/armeabi-v7a, /system/lib, /product/lib]]

标签: androidandroidx

解决方案


该类重命名为androidx.core.content.ContextCompat,请参阅规范。您需要将旧引用更改为新引用。


推荐阅读