安卓 – 当我选择伦敦位置时,我在谷歌地图上崩溃了

前端之家收集整理的这篇文章主要介绍了安卓 – 当我选择伦敦位置时,我在谷歌地图上崩溃了前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在我的一个应用程序中实现了谷歌地图,当我选择任何位置而不是伦敦时,一切都工作正常,但当我试图选择伦敦的任何位置并试图放大和缩小比应用程序将崩溃.

请帮我.我只是想用谷歌地图做这件事,我不想使用任何第三方地图.

DisplayMetrics displayMetrics = new DisplayMetrics();
            getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
            int height = displayMetrics.heightPixels;
            int width = displayMetrics.widthPixels;
            LatLngBounds bounds = new LatLngBounds(new LatLng(lat,lng),new LatLng(lat,lng));
            googleMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds,width,height,20));

Logcat:

07-02 05:20:35.409 32739-665/com.example E/AndroidRuntime: FATAL
EXCEPTION: GLThread 19450
Process: com.example,PID: 32739
java.lang.StackOverflowError: stack size 1037KB
at com.google.maps.api.android.lib6.common.i.(:com.google.android.gms.dynamite_dynamitemodulesb@12685025@12.6.85
(040408-197041431):9)

解决方法

Google问题跟踪器中有多个关于东京,旧金山,伦敦等不同城市崩溃的报告

https://issuetracker.google.com/issues/35829548

请随意标记错误添加您的投票并订阅通知.

来自Google的最后一条消息是2018年6月25日

We’ll actually keep using this issue for instances of this crash where indoor maps are disabled,sorry for the confusion.

We are currently internally testing a fix for this issue and will add it to the updates pipeline once it’s ready. Due to the timing of release cycles,we still recommend disabling indoor maps as best short-term workaround for now if you or your users are heavily affected. We will post an update here when the fix for this issue is rolled-out.

尝试按照他们的建议并设置googleMap.setIndoorEnabled(false);作为一种解决方法.

更新

好消息. Google于2018年10月20日将该错误标记为已修复.此外,Google Play服务中最新版Google地图Android SDK的发行说明中也提到了此错误

https://developers.google.com/maps/documentation/android-sdk/releases#october_18_2018

原文链接:https://www.f2er.com/android/316755.html

猜你在找的Android相关文章