Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method glt.a

↘锁芯ラ 提交于 2019-11-29 22:29:33

The Issue is probably happening because the Map is not loaded and the app is trying to locate you in an unloaded Map. The Map is not loading with your api key or package name. I think your api key has got changed . Please check your api key and package name.

E_X

I did two things in order for google map to work:

  1. use the mapView instead of MapFragment or SupportMapFragment.
  2. if the map you implemented uses the user's current location, then you must check if the user have his location service enabled and implement your map based on that using a method

like so for example:

public boolean isLocationServiceEnabled() {
    LocationManager locationManager = (LocationManager) getActivity().getSystemService(Context.LOCATION_SERVICE);
    if(!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) && !locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {
            //All location services are disabled
        return false;
    }
    return true;
}

For new visitors, if your code and api key are okay then please check if your device has internet connection. Because I forgot the switch on internet then I got same error.

For me setting Eclipse's Preferences -> Android -> Build -> Custom keystore fixed the problem. Also uninstall app and clean build.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!