簡體   English   中英

找不到方法gls.a引用的類“ com.google.android.gms.location.internal.ParcelableGeofence”

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

在我開始之前,我嘗試過在stackoverflow以及其他論壇上發布的類似問題下提供的所有解決方案,但均無濟於事:

我有以下代碼來渲染地圖...它工作了幾天,然后徹底停止工作。 我已經更改了API密鑰,但也沒有任何更改。

public class The_Map_Fragment extends SherlockFragment  {
..........
..........
if (googleMap == null) {
        googleMap = ((SupportMapFragment)getFragmentManager().findFragmentById(R.id.map)).getMap();

        googleMap.setMyLocationEnabled(true); 
        googleMap.getUiSettings().setZoomControlsEnabled(true);
        googleMap.getUiSettings().setZoomGesturesEnabled(true);
        googleMap.getUiSettings().setMyLocationButtonEnabled(true);
        CameraPosition cameraPosition = new CameraPosition.Builder().target(new LatLng(-1.281509, 36.816974)).zoom(13).build();
        googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); 
        if (googleMap == null) {
            Toast.makeText(getActivity(),"Sorry! unable to Instatntiate Google Maps", Toast.LENGTH_SHORT).show();


        }


    }

我的xml如下:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

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

我的清單具有所有引用和權限,可以

<permission android:name="com.the.app.rr.permission.MAPS_RECEIVE"  
    android:protectionLevel="signature" />
<uses-permission android:name="com.the.app.rr.permission.MAPS_RECEIVE" />

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

<!-- Required to show current location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-feature android:glEsVersion="0x00020000" android:required="true"/>

運行時出現錯誤,找不到方法gls.a引用的類'com.google.android.gms.location.internal.ParcelableGeofence'

對我來說,設置Eclipse的Preferences-> Android-> Build-> Custom keystore可以解決此問題。 還要卸載應用程序並清理構建。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM