Não consigo compilar o projeto, sempre que tento compilar ocorre o erro: error: cannot access zzbgl class file for com.google.android.gms.internal.zzbgl not found
Toda vez que eu faço click duplo no erro eu sou jogado para a linha onde está o código:
request.setSmallestDisplacement(50);
Segue abaixo o codigo da classe Localizador:
package br.com.alura.agenda;
import android.annotation.SuppressLint;
import android.content.Context;
import android.location.Location;
import android.os.Bundle;
import android.support.annotation.Nullable;
import com.google.android.gms.common.api.GoogleApiClient;
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.maps.CameraUpdate;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.LatLng;
public class Localizador implements GoogleApiClient.ConnectionCallbacks, LocationListener {
private final GoogleApiClient client;
private final GoogleMap mapa;
public Localizador(Context context, GoogleMap mapa) {
client = new GoogleApiClient.Builder(context)
.addApi(LocationServices.API)
.addConnectionCallbacks(this)
.build();
client.connect();
this.mapa = mapa;
}
@Override
public void onConnected(@Nullable Bundle bundle) {
LocationRequest request = new LocationRequest();
request.setSmallestDisplacement(50);
request.setInterval(1000);
request.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
LocationServices.FusedLocationApi.requestLocationUpdates(client, request, this);
}
@Override
public void onConnectionSuspended(int i) {
}
@Override
public void onLocationChanged(Location location) {
LatLng coordenada = new LatLng(location.getLatitude(), location.getLongitude());
CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLng(coordenada);
mapa.moveCamera(cameraUpdate);
}
}