微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

我在我的一个应用程序中实现了谷歌地图,当我选择任何位置而不是伦敦时,一切都工作正常,但当我试图选择伦敦的任何位置并试图放大和缩小比应用程序将崩溃.

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

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐