Android Google Play Maps: Fatal Exception: java.lang.NoClassDefFoundError

May 17, 2019
Failed resolution of: Lorg/apache/http/ProtocolVersion;

I bump into the following error when upgrading compileSdkVersion/targetSdkVersion to 28 (from 27) while using implementation '

Fatal Exception: java.lang.NoClassDefFoundError
Failed resolution of: Lorg/apache/http/ProtocolVersion;

NOTE: The error didn’t occur on Android Pie (API 28) emulator / Android Lollipop (API 21) Phone / Android Oreo (API 26 Phone). It happened on a Android Pie (API 28) Phone.

Based on this source:

If you are using or below and your app is targeting API level 28 (Android 9.0) or above, you must include the following declaration within the element of AndroidManifest.xml.

<?xml version="1.0" encoding="utf-8"?>
<manifest ..>
        android:required="false" />

This is handled for you if you are using and is not necessary if your app is targeting a lower API level.

NOTE: I opt to use to solve problem instead.

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.