一切都工作正常,然后突然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.
答案 0 :(得分:1)
问题可能正在发生,因为未加载地图并且应用程序试图在卸载的地图中找到您。地图未加载您的API密钥或包名称。我认为你的api密钥已经改变了。请检查您的api密钥和包裹名称。
答案 1 :(得分:0)
为了让谷歌地图发挥作用,我做了两件事:
就像这样:
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;
}
答案 2 :(得分:-1)
对于新访问者,如果您的代码和API密钥没问题,请检查您的设备是否有互联网连接。因为我忘了互联网上的开关然后我得到了同样的错误。
答案 3 :(得分:-2)
为我设置Eclipse的首选项 - &gt; Android - &gt;构建 - &gt;自定义密钥库修复了该问题。还卸载应用程序并清理构建。