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

前端 未结 4 1655
南笙
南笙 2020-12-24 08:21

Everything was working ok, then suddenly eclipse started breaking asking for a perspective switch and going to debug mode with the error \'Link of class \"Lcom/google/andro

相关标签:
4条回答
  • 2020-12-24 09:02

    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;
    }
    
    0 讨论(0)
  • 2020-12-24 09:03

    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.

    0 讨论(0)
  • 2020-12-24 09:04

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

    0 讨论(0)
  • 2020-12-24 09:10

    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.

    0 讨论(0)
提交回复
热议问题