切换到targetSdkVersion 28(Android)时发生DefaultHttpClient NoClassDefFoundError

时间:2019-06-21 11:56:57

标签: java android apache-httpclient-4.x

我的应用与

完美搭配
  

targetSdkVersion 26

但是切换到

  

targetSdkVersion 28

I get an java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/impl/client/DefaultHttpClient

任何提示,想法吗?

1 个答案:

答案 0 :(得分:0)

在“应用程序”下的清单文件中添加以下内容:

hashUser.values().forEach(user -> System.out.println("Username: " + user.getUsername() + " Password: "  + user.getPassword()));

https://developer.android.com/about/versions/pie/android-9.0-changes-28#apache-p