java.lang.ClassNotFoundException: Didn't find class "org.apache.http.HttpRequestInterceptor"

Android p 适配

  • 错误问题
  • 解决方案

错误问题

  Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.HttpRequestInterceptor" on path: DexPathList[[zip file "/data/app/gov.pianzong.httpclientproject-zu3u66lZlpKEabtNUuI35w==/base.apk"],nativeLibraryDirectories=[/data/app/gov.pianzong.httpclientproject-zu3u66lZlpKEabtNUuI35w==/lib/arm64, /system/lib64, /product/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

解决方案

在清单文件AndroidManifest.xml 的Application中添加如下代码:

<uses-library android:name="org.apache.http.legacy" android:required="false" />

问题完美解决。

你可能感兴趣的:(android)