繁体   English   中英

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

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

一切都工作正常,然后突然eclipse开始打破要求透视切换并进入调试模式,错误'类链接“Lcom / google / android / gms / location / internal / ParcelableGeoFence;” 失败。 谷歌搜索问题无处可去。 调试器指向PathClassLoader(BaseDexClassLoader).findClass(String)行: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.

问题可能正在发生,因为未加载地图并且应用程序试图在卸载的地图中找到您。 地图未加载您的API密钥或包名称。 我认为你的api密钥已经改变了。 请检查您的api密钥和包裹名称。

为了让谷歌地图工作,我做了两件事:

  1. 使用mapView而不是MapFragment或SupportMapFragment。
  2. 如果您实施的地图使用用户的当前位置,那么您必须检查用户是否启用了其位置服务,并使用方法实现基于该地图的地图

像这样的例子:

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的首选项 - > Android - > Build - > Custom keystore修复了问题。 还卸载应用程序并清理构建。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM