gpt4 book ai didi

android - 当我只选择伦敦位置时,我在谷歌地图上崩溃了

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:20:52 26 4
gpt4 key购买 nike

我已经在我的一个应用程序中实现了谷歌地图,当我选择任何位置而不是伦敦时,一切都运行良好,但是当我尝试选择伦敦的任何位置并尝试放大和缩小应用程序时会崩溃。

请帮帮我。我只想使用 Google map 来完成,我不想使用任何第三方 map 。

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));

日志:

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); 作为解决方法。

更新

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

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

关于android - 当我只选择伦敦位置时,我在谷歌地图上崩溃了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51134611/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com