title: Map crashes in Nexus 5X API 28 but runs perfectly fine in Google PIXEL 2 XL API 27
body: <p>I have followed the Google Developer's Guide to create a map activity using Google Map's API. My API key is already activated, so what's the cause of the crash in Nexus 5X.</p>
  
  <p>Sharing my AndroidManifest.xml,MapActivity.java,google_maps_api.xml,activitymaps.xml and Gradle module:-</p>
  
  <p><strong>AndroidManifest.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.kiit.mapone"&gt;
  
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:roundIcon="@mipmap/ic_launcher_round"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
  
          &lt;meta-data
              android:name="com.google.android.geo.API_KEY"
              android:value="@string/google_maps_key" /&gt;
  
          &lt;activity
              android:name=".MapsActivity"
              android:label="@string/title_activity_maps"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p><strong>MapsActivity.java</strong></p>
  
  <pre><code>package com.example.kiit.mapone;
  
  import android.support.v4.app.FragmentActivity;
  import android.os.Bundle;
  
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.OnMapReadyCallback;
  import com.google.android.gms.maps.SupportMapFragment;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.MarkerOptions;
  
  public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
  
      private GoogleMap mMap;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_maps);
          // Obtain the SupportMapFragment and get notified when the map is ready to be used.
          SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
                  .findFragmentById(R.id.map);
          mapFragment.getMapAsync(this);
      }
  
      @Override
      public void onMapReady(GoogleMap googleMap) {
          mMap = googleMap;
  
          // Add a marker in Sydney and move the camera
          LatLng sydney = new LatLng(-34, 151);
          mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
          mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
      }
  }
  </code></pre>
  
  <p><strong>google_maps_api.xml</strong></p>
  
  <pre><code>&lt;resources&gt;
      &lt;string name="google_maps_key" templateMergeStrategy="preserve" translatable="false"&gt;KEY IS HERE&lt;/string&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p><em>I have replaced my API key with "KEY IS HERE" in this file due to security reasons</em></p>
  
  <p><strong>activity_maps.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;fragment xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:map="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/map"
      android:name="com.google.android.gms.maps.SupportMapFragment"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MapsActivity" /&gt;
  </code></pre>
  
  <p><strong>build.gradle(Module:app)</strong></p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 28
      defaultConfig {
          applicationId "com.example.kiit.mapone"
          minSdkVersion 23
          targetSdkVersion 28
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation 'com.android.support:appcompat-v7:28.0.0'
      implementation 'com.google.android.gms:play-services-maps:16.0.0'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.2'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
  }
  </code></pre>
  
  <p><strong>Logcat(errors):</strong></p>
  
  <pre><code>2018-12-18 10:06:42.509 27581-27610/com.example.kiit.mapone E/AndroidRuntime: FATAL EXCEPTION: Thread-5
      Process: com.example.kiit.mapone, PID: 27581
      java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion;
          at ez.b(:com.google.android.gms.dynamite_mapsdynamite@14799084@14.7.99 (100700-223214910):3)
          at ey.a(:com.google.android.gms.dynamite_mapsdynamite@14799084@14.7.99 (100700-223214910):3)
          at fa.a(:com.google.android.gms.dynamite_mapsdynamite@14799084@14.7.99 (100700-223214910):15)
          at com.google.maps.api.android.lib6.drd.al.a(:com.google.android.gms.dynamite_mapsdynamite@14799084@14.7.99 (100700-223214910):6)
          at ed.a(:com.google.android.gms.dynamite_mapsdynamite@14799084@14.7.99 (100700-223214910):21)
          at ed.run(:com.google.android.gms.dynamite_mapsdynamite@14799084@14.7.99 (100700-223214910):8)
       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/0000000d/MapsDynamite.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/0000000d/MapsDynamite.apk!/lib/x86, /system/lib]]
          at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
          at ad.loadClass(:com.google.android.gms.dynamite_dynamiteloader@14799084@14.7.99 (100700-223214910):4)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
          at ez.b(:com.google.android.gms.dynamite_mapsdynamite@14799084@14.7.99 (100700-223214910):3) 
          at ey.a(:com.google.android.gms.dynamite_mapsdynamite@14799084@14.7.99 (100700-223214910):3) 
          at fa.a(:com.google.android.gms.dynamite_mapsdynamite@14799084@14.7.99 (100700-223214910):15) 
          at com.google.maps.api.android.lib6.drd.al.a(:com.google.android.gms.dynamite_mapsdynamite@14799084@14.7.99 (100700-223214910):6) 
          at ed.a(:com.google.android.gms.dynamite_mapsdynamite@14799084@14.7.99 (100700-223214910):21) 
          at ed.run(:com.google.android.gms.dynamite_mapsdynamite@14799084@14.7.99 (100700-223214910):8) 
  2018-12-18 10:06:42.660 27581-27581/com.example.kiit.mapone E/SchedPolicy: set_timerslack_ns write failed: Operation not permitted
  </code></pre>