1

My app works perfect with

targetSdkVersion 26

but when switching to

targetSdkVersion 28

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

any hints , ideas ?

mcfly soft
  • 11,289
  • 26
  • 98
  • 202

1 Answers1

2

Add the following to your manifest file under 'application':

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

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

NikhilReddy
  • 6,904
  • 11
  • 38
  • 58
  • I already found this before and tried, but did not work. Any other help, explanations. – mcfly soft Jun 21 '19 at 13:04
  • https://stackoverflow.com/questions/50461881/java-lang-noclassdeffounderrorfailed-resolution-of-lorg-apache-http-protocolve Can you read this answer – NikhilReddy Jun 21 '19 at 14:18
  • 1
    I forgot to clean and rebuild first, thats why it didn't work first time for me. But now its working with the above declaration. Thanks for helping. – mcfly soft Jun 23 '19 at 09:14