Android P org.apache.http.legacy.jar 找不到

从Android P开始,org.apache.http.legacy 库将从 bootclasspath 中删除。

Remove org.apache.http.legacy from bootclasspath

也就是进程启动时压根不会去加载这个jar,当你代码中使用到这个库中的类会抛出java.lang.ClassNotFoundException: Didn't find class ***

解决办法:

此方法只满足target>= 28时有效

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

当然,还是建议尽早替换org.apache.http.legacy,毕竟在android 6.0时就要求替换了。

猜你喜欢

转载自blog.csdn.net/gjd1988/article/details/86484158