15

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/android/gms/location/internal/ParcelableGeoFence;" failed. Googling the problem lead nowhere. Debugger points to PathClassLoader(BaseDexClassLoader).findClass(String) line: 61
Strangely when I remove map.setMyLocationEnabled(true); from my code it no longer crashes but still I can see this in logcat

E/dalvikvm(5639): Could not find class 'gpr', referenced from method gps.a
W/dalvikvm(5639): VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;

here is full log:

07-03 13:07:31.677: W/dalvikvm(5639): VFY: unable to resolve static method 24936: Lguj;.a 

(Landroid/content/Context;)Lgri;
07-03 13:07:31.697: E/dalvikvm(5639): Could not find class 'gpr', referenced from method gps.a
07-03 13:07:31.697: W/dalvikvm(5639): VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;
07-03 13:07:31.697: E/dalvikvm(5639): Could not find class 'gpr', referenced from method gps.a
07-03 13:07:31.697: W/dalvikvm(5639): VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;
07-03 13:07:31.697: E/dalvikvm(5639): Could not find class 'gpr', referenced from method gps.a
07-03 13:07:31.697: W/dalvikvm(5639): VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;
07-03 13:07:31.707: I/Google Maps Android API(5639): Google Play services package version: 5084034
07-03 13:07:31.737: W/dalvikvm(5639): VFY: unable to resolve static field 20873 (t) in Lyp;
07-03 13:07:31.737: W/dalvikvm(5639): VFY: unable to resolve static field 20873 (t) in Lyp;
07-03 13:07:32.778: W/dalvikvm(5639): Link of class 'Lcom/google/android/gms/location/internal/ParcelableGeofence;' failed
07-03 13:07:32.778: E/dalvikvm(5639): Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method glt.a
07-03 13:07:32.778: W/dalvikvm(5639): VFY: unable to resolve check-cast 2086 (Lcom/google/android/gms/location/internal/ParcelableGeofence;) in Lglt;
07-03 13:07:34.089: I/Adreno200-EGLSUB(5639): <ConfigWindowMatch:2078>: Format RGBA_8888.
07-03 13:07:34.319: D/LOCATION(5639): Connected
07-03 13:07:34.319: I/Adreno200-EGLSUB(5639): <ConfigWindowMatch:2089>: Format RGBX_8888.
Vilen
  • 5,061
  • 3
  • 28
  • 39

4 Answers4

1

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.

Utsav Gupta
  • 3,785
  • 5
  • 30
  • 52
  • no that's not the case, no matter when I call map.setMyLocationEnabled(true); also api key was not changed. I even reverted the code for few days via git but still no luck, I guess it is something related to adt. – Vilen Jul 04 '14 at 12:15
  • Did u do an eclipse update? Coz that will change ur sha1 code. And hence your api key wud need to be changed. – Utsav Gupta Jul 05 '14 at 01:17
  • no I didn't, but still I created new map api key, unfortunately no luck. Strange thing is that application works after that error – Vilen Jul 05 '14 at 09:19
  • Even i have the same issue so i generated new API key and pasted in manifest file but when i go to debug mode and start the application this same error comes. And my home page is map so it is not loading map. But without debug mode if u run app it works fine. – Nav Jul 08 '14 at 05:35
  • Check if the sha1 code of yor eclipse matches the code you pasted on google console – Utsav Gupta Jul 10 '14 at 11:33
  • @Mr.Hyde not yet, I would post solution – Vilen Jul 23 '14 at 08:46
  • @VilenMelkumyan Unfortunately i have your problem too and i don't know the solution! But i know it's happen to me after move my map from FragmentActivity to Fragment in a ViewPager! And every situation about API KEY changes that discussed not happened to me. – Dr.jacky Jul 23 '14 at 09:18
  • I am facing exactly the same problem. But the problem is device specific. As the app is working fine on other devices then on a particular device – Abhishek Batra Jul 26 '14 at 19:26
  • it is a device generic issue..I tries in my Nexus 7 and the error persisted whereas while it tries in Moto E everything was working smoothly – williamj949 Aug 02 '14 at 11:14
0

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;
}
Volker Siegel
  • 3,277
  • 2
  • 24
  • 35
E_X
  • 3,722
  • 1
  • 14
  • 15
-1

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.

Ozan
  • 1,191
  • 2
  • 16
  • 31
  • C'mon, you think that I am debugging map app without internet connection or invalid api key ? and so many people have same issue ? – Vilen Sep 19 '14 at 08:37
  • That answer for developer who debugging map app without internet connection because we are human so MAYBE we can forget to open internet connection when we debugging. That answer is just an ADVICE TO CHECK MAYBE CONNECTION IS NOT OK – Ozan Sep 19 '14 at 08:44
-2

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

SpyZip
  • 5,511
  • 4
  • 32
  • 53
  • tried it, created new custom key, then google api key based on custom keystore, uninstalled the project from device, cleaned workspace, but no change, anyway thanks for help – Vilen Aug 21 '14 at 14:57