找不到类的com.google.android.gms.location.internal.ParcelableGeofence [英] Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence

查看:198
本文介绍了找不到类的com.google.android.gms.location.internal.ParcelableGeofence的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想,以显示我的应用程序映射。我用这code

I am trying to display a map in my application. I am using this code

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中,我总是得到这个错误:

and it is working, it displays it, it displays the polygons I created on it, everything works. But in the logcat, I'm always getting this error:

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

我不知道如何解决它。任何人都知道是什么原因造成的?

I have no idea how to fix it. Anyone knows what causes this?

推荐答案

其中的原因出现此错误是,如果你已经更新了你的Eclipse那么你的API密钥会改变。

One of the reason to get this error is if you have updated your eclipse then your API key would have changed.

要获得SHA1指纹你必须遵循这个环节,
[<一个href=\"http://stackoverflow.com/questions/11146512/getting-google-maps-api-debug-key-with-windows-command-prompt%5d\">http://stackoverflow.com/questions/11146512/getting-google-maps-api-debug-key-with-windows-command-prompt]

To get SHA1 fingerprint you have to follow this link, [http://stackoverflow.com/questions/11146512/getting-google-maps-api-debug-key-with-windows-command-prompt]

从SHA1指纹你可以从谷歌控制台站点API密钥。
[<一个href=\"http://www.technicaladvices.com/2012/03/19/generating-keys-for-google-maps-api-using-the-apis-console/%5d\" rel=\"nofollow\">http://www.technicaladvices.com/2012/03/19/generating-keys-for-google-maps-api-using-the-apis-console/]

From SHA1 fingerprint you can get API key from Google Console site. [http://www.technicaladvices.com/2012/03/19/generating-keys-for-google-maps-api-using-the-apis-console/]

粘贴清单文件API密钥

Paste that API key in manifest file

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

我希望这有助于。

I hope this helps.

这篇关于找不到类的com.google.android.gms.location.internal.ParcelableGeofence的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆