找不到类';com.google.android.gms.location.internal.parcelablegeofinence

找不到类';com.google.android.gms.location.internal.parcelablegeofinence,android,google-maps,Android,Google Maps,我正在尝试在应用程序中显示地图。我正在使用这个代码 map.setMyLocationEnabled(true); //get locationManager object from System Service LOCATION_SERVICE LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); //create a criteria object to retrie

我正在尝试在应用程序中显示地图。我正在使用这个代码

map.setMyLocationEnabled(true);

//get locationManager object from System Service LOCATION_SERVICE
LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);

//create a criteria object to retrieve provider
Criteria criteria = new Criteria();

//get the name of the best provider
String provider = locationManager.getBestProvider(criteria, true);

//get current location
Location myLocation = locationManager.getLastKnownLocation(provider);

//set map type
map.setMapType(GoogleMap.MAP_TYPE_NORMAL);

//get latitude and longitude of the current location
double latitude = myLocation.getLatitude();
double longitude = myLocation.getLongitude();

//create LatLng object for the current location
LatLng latLng = new LatLng(latitude, longitude);

//show the current location in Google Map
map.moveCamera(CameraUpdateFactory.newLatLng(latLng));

map.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 10));
//zoom in the Google Map
map.animateCamera(CameraUpdateFactory.zoomTo(13));
它正在工作,它显示它,它显示我在上面创建的多边形,一切都正常。但在logcat中,我总是遇到这样的错误:

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

我不知道如何修理它。有人知道这是什么原因吗?

出现此错误的原因之一是,如果您更新了eclipse,那么您的API密钥就会发生更改

要获取SHA1指纹,您必须遵循此链接, [

通过SHA1指纹,您可以从谷歌控制台站点获取API密钥。 [

将该API密钥粘贴到清单文件中

 <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="your api key" />


我希望这能有所帮助。

很抱歉没有回复,我不在城里,所以我一上电脑就会试试。@grayFox16你明白了吗?@Naveen我尝试过这个解决方案,但问题仍然存在。这可能是因为ADT和SDK更新到最新版本,我的电脑也存在这个问题case@Jiazzy这是你必须完成的基本步骤遵循。最好的办法是对代码进行备份,只需使用新的adt包,它肯定会像魅力一样工作。在尝试了所有不同的事情后,这对我来说是有效的。我已经尝试过更改api密钥(我还更改了应用程序的名称,所以我不得不这样做)错误不再显示了,所以我将把它标记为正确答案