title: App is crashing while running AVD in Android Studio. I am running on virtual device pixel 5x with API 27
body: <p>When I try to create and instance of FusedLocationApi it doesn't get recognized some How. it is in red. It is not importing any classes. seems to me that there might be some problem in Gradle Build App. Please Check it out.</p>
  
  <p>This is My MapActivity.java File</p>
  
  <pre><code>package com.matt.mapapp;
  import android.Manifest;
  import android.content.pm.PackageManager;
  import android.location.Location;
  import android.support.annotation.NonNull;
  import android.support.annotation.Nullable;
  import android.support.v4.app.ActivityCompat;
  import android.support.v4.app.FragmentActivity;
  import android.os.Bundle;
  import android.support.v4.content.ContextCompat;
  
  import com.google.android.gms.common.ConnectionResult;
  import com.google.android.gms.location.LocationRequest;
  import com.google.android.gms.location.LocationServices;
  import com.google.android.gms.location.LocationListener;
  import com.google.android.gms.common.api.GoogleApiClient;
  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, GoogleApiClient.ConnectionCallbacks,     
  GoogleApiClient.OnConnectionFailedListener, LocationListener {
  
  private GoogleMap mMap;
  private LocationRequest locationRequest;
  private GoogleApiClient client;
  @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;
      if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
         String[] permissions,
          buildGoogleApiClient();
          mMap.setMyLocationEnabled(true);
  
      }
  
  }
  private synchronized void buildGoogleApiClient(){
      client = new GoogleApiClient.Builder(this)
              .addConnectionCallbacks(this)
              .addOnConnectionFailedListener(this)
              .addApi(LocationServices.API)
              .build();
      client.connect();
  }
  
  
  @Override
  public void onLocationChanged(Location location) {
      locationRequest = new LocationRequest();
      locationRequest.setInterval(1000);
      locationRequest.setFastestInterval(1000);
      locationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
  
      if(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED){
          LocationRequest.FusedLocationApi.requestlocationUpdates(client, locationRequest, this);
      }
  
  
  }
  
  @Override
  public void onConnected(@Nullable Bundle bundle) {
  
  }
  
  @Override
  public void onConnectionSuspended(int i) {
  
  }
  
  @Override
  public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
  
  }
  }
  </code></pre>
  
  <p>This is my build gradle (Module app) File. There seemed to be some problem in compiling as there is no such command as compile</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
     android {
         compileSdkVersion 26
         defaultConfig {
             applicationId "com.matt.mapapp"
             minSdkVersion 22
             targetSdkVersion 26
             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:26.0.0-beta1'
         implementation 'com.google.android.gms:play-services-maps:11.0.4'
         implementation 'com.google.android.gms:play-services-location:11.0.4'
         testImplementation 'junit:junit:4.12'
         androidTestImplementation 'com.android.support.test:runner:0.5'
         androidTestImplementation'com.android.support.test.espresso:espresso-core:2.2.2'
  }
  </code></pre>
  
  <p>please Check it out and tell me the reason behind. I was following a video tutorial on how to create a map based app and suddenly when I reached at a point to use Fused Location Api I got stuck. The Build Gradle code in the tutorial was different than mine so I thing that this can be the reason for the FusedLocationApi to not work properly.</p>