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

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

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

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

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...