Here is How to Fix java.lang.NoClassDefFoundError in Android Studio

Android Studio How to Fix java.lang.NoClassDefFoundError:failed resolution of :Lorg/apache/http/ProtocolVersion

This is an error associated with the google-play-services libraries and the http apache library. To fix this, do the following

Add dependency

In your app-level build.gradle file, add the Maps dependency like below:

dependencies {     implementation 'com.google.android.gms:play-services-maps:17.0.0' }

Add the code below to androidmanifest.xml

This code should be inside the <application …/> element (direct child)

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

That’s it, this should fix the error now

 

Post navigation

Comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.