簡體   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