12

I am testing Google Map on Google Pixel running the latest version of Android Pie.

Caused by java.lang.ClassNotFoundException
Didn't find class "org.apache.http.ProtocolVersion" on path: DexPathList[[zip file "/data/user_de/0/com.google.android.gms/app_chimera/m/0000000e/MapsDynamite.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/0000000e/MapsDynamite.apk!/lib/arm64-v8a, /system/lib64]]
mihirjoshi
  • 12,161
  • 7
  • 47
  • 78

3 Answers3

30

This error occurs on Android 9.0. Add the below code in the <application> element of manifest

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

Refer to Specify requirement for Apache HTTP Legacy library docs.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
Anubhav Gupta
  • 2,492
  • 14
  • 27
4

Google map is not property supported android 9+. Use the following code in your manifest file. it will work.

 <uses-library
            android:name="org.apache.http.legacy"
            android:required="false" />
Rajneesh Shukla
  • 1,048
  • 13
  • 21
0

Thanks to @Anubhav Gupta, you can also update in build.gradle:

implementation "com.google.android.gms:play-services-base:16.1.0"

But this can brake a compatibility with Android 4, see App is having trouble with Google Play Services. Please try again.

CoolMind
  • 26,736
  • 15
  • 188
  • 224