NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion とかでた。

[Developer Preview Android P] NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion; inside of com.google.android.gms [79478779] - Visible to Public - Issue Tracker

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

対策は以下。AndroidManifest.xml。


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

Project Configuration  |  Maps SDK for Android  |  Google Developers

今回は、GoogleMap SDK vs API-28(9.0/Pie) だったけど、他でも出そうで、使えそう。


関連ワード:  AndroidAndroidStudioGoogleライブラリ開発