找不到类"com.google.android.gms.location.internal.ParcelableGeofence",引用自方法 glt.a



一切都工作正常,然后突然eclipse开始崩溃,要求透视切换并进入调试模式,错误'类链接"Lcom/google/android/gms/location/internal/ParcelableGeoFence;"失败。在谷歌上搜索这个问题一无所获。调试器指向PathClassLoader(BaseDexClassLoader).findClass(String) line: 61
奇怪的是,当我删除map。setmylocationenabled (true);从我的代码中,它不再崩溃,但我仍然可以在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;

这里是完整的日志:

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.

问题可能是因为地图未加载,应用程序试图在未加载的地图中定位您。Map没有加载您的api密钥或包名。我想您的api密钥已经更改了。请检查api密钥和包名

为了让google map工作,我做了两件事:

  1. 使用mapView代替MapFragment或SupportMapFragment。
  2. 如果你实现的地图使用了用户的当前位置,那么你必须检查用户是否启用了他的位置服务,并使用
  3. 方法基于此实现你的地图

,例如:

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;
}

对于新访客,如果您的代码和api密钥是好的,那么请检查您的设备是否有互联网连接。

对我来说,设置Eclipse的Preferences -> Android -> Build -> Custom keystore解决了这个问题。

最新更新