5

我有一個應用程序,其中主頁是地圖。找不到類com.google.android.gms.location.internal.ParcelableGeofence引用方法glt.a

不知道爲什麼我收到此錯誤,這個錯誤Could not find class 'gpr', referenced from method gps.a

我已經更新日食一起,所以我試圖改變與新SHA1指紋API密鑰。但那不行。

我的應用程序是當您打開應用程序時顯示當前位置。它只是登陸到整個地圖,但在LOG貓我得到這些錯誤。 這裏是我的logcat

`07-08 12:54:39.897: I/Google Maps Android API(25749): Google Play services client version: 5077000 

07-08 12:54:39.907: I/dalvikvm(25749): Could not find method guj.a, referenced from method gqi.a 

07-08 12:54:39.907: W/dalvikvm(25749): VFY: unable to resolve static method 24936: Lguj;.a (Landroid/content/Context;)Lgri; 

07-08 12:54:39.907: D/dalvikvm(25749): VFY: replacing opcode 0x71 at 0x0003 

07-08 12:54:39.917: E/dalvikvm(25749): Could not find class 'gpr', referenced from method gps.a 

07-08 12:54:39.917: W/dalvikvm(25749): VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps; 

07-08 12:54:39.917: D/dalvikvm(25749): VFY: replacing opcode 0x22 at 0x0000 

07-08 12:54:39.927: E/dalvikvm(25749): Could not find class 'gpr', referenced from method gps.a 

07-08 12:54:39.927: W/dalvikvm(25749): VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps; 

07-08 12:54:39.927: D/dalvikvm(25749): VFY: replacing opcode 0x22 at 0x0000 

07-08 12:54:39.927: E/dalvikvm(25749): Could not find class 'gpr', referenced from method gps.a 

07-08 12:54:39.927: W/dalvikvm(25749): VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps; 

07-08 12:54:39.927: D/dalvikvm(25749): VFY: replacing opcode 0x22 at 0x0000 

07-08 12:54:39.937: D/dalvikvm(25749): DexOpt: unable to opt direct call 0x5ea3 at 0x0a in Lgps;.a 

07-08 12:54:39.937: D/dalvikvm(25749): DexOpt: unable to opt direct call 0x5ea3 at 0x0c in Lgps;.a 

07-08 12:54:39.937: D/dalvikvm(25749): DexOpt: unable to opt direct call 0x5ea3 at 0x0a in Lgps;.a 

07-08 12:54:39.957: I/Google Maps Android API(25749): Google Play services package version: 5084034 

07-08 12:54:39.977: W/dalvikvm(25749): VFY: unable to resolve static field 20873 (t) in Lyp; 

07-08 12:54:39.977: D/dalvikvm(25749): VFY: replacing opcode 0x62 at 0x000e 
07-08 12:54:39.977: W/dalvikvm(25749): VFY: unable to resolve static field 20873 (t) in Lyp; 

07-08 12:54:39.977: D/dalvikvm(25749): VFY: replacing opcode 0x62 at 0x000d 

07-08 12:54:40.888: I/dalvikvm(25749): Failed resolving Lcom/google/android/gms/location/internal/ParcelableGeofence; interface 4023 'Lgln;' 

07-08 12:54:40.888: W/dalvikvm(25749): Link of class 'Lcom/google/android/gms/location/internal/ParcelableGeofence;' failed 

07-08 12:54:40.898: E/dalvikvm(25749): Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method glt.a 

07-08 12:54:40.898: W/dalvikvm(25749): VFY: unable to resolve check-cast 2086 (Lcom/google/android/gms/location/internal/ParcelableGeofence;) in Lglt; 

07-08 12:54:40.898: D/dalvikvm(25749): VFY: replacing opcode 0x1f at 0x0019 

07-08 12:54:41.589: W/ActivityThread(25749): ClassLoader.loadClass: The class loader returned by Thread.getContextClassLoader() may fail for processes that host multiple applications. You should explicitly specify a context class loader. For example: Thread.setContextClassLoader(getClass().getClassLoader());` 

我試圖以Google它,它似乎沒有妥善的解決辦法又那麼這將是有益的,如果有人可以幫助我。

+0

這與Eclipse無關,我使用AS和我遇到了同樣的問題。這似乎與Google Play Services上次更新有關。 – Imanol

+0

他們已經棄用了一些API在這裏看看:http://developer.android.com/reference/com/google/android/gms/location/package-summary.html – Imanol

+1

可能重複[無法找到類com。 google.android.gms.location.internal.ParcelableGeofence',引用方法glt.a](http://stackoverflow.com/questions/24549846/could-not-find-class-com-google-android-gms-location -internal-parcelablegeofenc) –

回答

4

我告訴你我是如何解決你有同樣的問題。

首先,我清理了所有的sdk,然後我再次下載了Google Play Services lib。然後,我刪除了我的電腦的.android文件夾,並重新生成了我的debug.keystore。

之後,我只是讓我的新SHA1獲得我的Google Maps V2 Api密鑰。

更新我的apikey後,讓我們看看如何更改我的代碼。

現在我在你的xml佈局中使用MapFragment的MapFragment片段。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".MapsActivity" > 

    <fragment 
     android:id="@+id/map" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     class="com.google.android.gms.maps.MapFragment" /> 

</RelativeLayout> 

並使用FragmentManager找到它:

public class MapsActivity extends Activity 
{ 
    private GoogleMap map; 

    @Override 
    protected void onCreate(Bundle savedInstanceState) 
    { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_map); 

     // Gets the MapView from the XML layout and creates it 
     map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap(); 
     map.getUiSettings().setMyLocationButtonEnabled(false); 
     //map.setMyLocationEnabled(true); 
     map.setOnMapClickListener(this); 
     map.setOnMapLongClickListener(this); 
     try 
     { 
      MapsInitializer.initialize(MapsActivity.this); 
     } 
     catch (Exception e) 
     { 
      e.printStackTrace(); 
     } 
    } 

我希望這是有幫助和抱歉,如果我的英語是如此糟糕, 問候

0

你可以發佈您的清單? Sans API密鑰,當然。

你的日誌看起來幾乎相同,煤礦的問題,我最近有,這是通過固定加入以下的清單:

<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> 

我工作剛訪問地圖應用罰款,然後停止了藍色。我看不到任何實際上指向缺少許可的內容;當我將清單與使用map api v2的另一個應用程序進行比較時,我只能理解它。

我仍然困惑爲什麼它以前沒有它的工作(谷歌說你需要許可地圖工作)。也許我曾經把它放在那裏,並意外刪除了這條線,但是無論採用哪種方式,都可以修復它。

來源: https://developers.google.com/maps/documentation/business/mobile/android/config

1

我曾在七月升級到API等級23(與客戶谷歌,播放service_lib 5.0.77)後,同樣的問題。

在測試設備上將Google Play服務更新到最新版本(6.1.09)後,問題得到解決。

因此,由於設備/仿真器上的Google Play服務版本與項目中的客戶端庫API(google-play-service_lib)之間的不兼容,似乎它已成爲(設備特定問題)。

根據谷歌的文檔,當客戶端比服務更新時,客戶端庫API應該解決過時的服務apk問題; (它在這種情況下確實不會影響已發佈的apk版本)https://developer.android.com/google/play-services/index.html

我之前嘗試通過使用新的API密鑰來解決此問題,並且如本文和其他類似問題中所建議的那樣,新安裝的Eclipse/ADT/SDK/google-play-service_lib無效。

相關問題