Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
341 views
in Technique[技术] by (71.8m points)

android - Is there a workaround/fix to these Google Maps v2 StackOverflowError crashes?

Seeing multiple crashes in my production app related to Google Maps v2, hundreds per day.

I can repro the issue even on Lyft, Yelp, Ritual apps.

Repro Steps

  1. Add com.google.android.gms:play-services-maps 11.8.0 or above (also crashes on 15.0.0) to app
  2. Get Google Play Services 12.6.85 (040400-197041431)
  3. Add SupportMapFragment
  4. Open app, center map on "Mission District" in San Francisco, CA, USA
  5. Try zooming in and out very fast, or scrolling up and down but always keeping Missin District in the center

Expected

  1. No Crash

Actual

  1. Crash

As an aggregate, the crashes hit multiple OS's: 5, 6, 7, 8. Individually, the crashes I've looked at target 1-2 OS's max, e.g. 5+6, 7, 7+8.

The stack traces all seem to involve com.google.maps.api.android.lib6.gmm6.indoor.* packages.

This is the closest issue I saw on AOSP Issue Tracker. Check out the Duplicates on that issue for similar issues with different stacktraces.

Here are snippets of some of the stacktraces I see (there are a LOT more):

Fatal Exception: java.lang.StackOverflowError: stack size 1038KB
       at java.util.HashMap.getEntry(HashMap.java:393)
       at java.util.HashMap.get(HashMap.java:348)
       at com.google.maps.api.android.lib6.gmm6.util.e.b(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040306-197041431):7)
       at com.google.maps.api.android.lib6.gmm6.indoor.o.c(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040306-197041431):193)

Fatal Exception: java.lang.StackOverflowError: stack size 1037KB
      at java.util.HashMap.createEntry(HashMap.java:826)
      at java.util.HashMap.addEntry(HashMap.java:813)
      at java.util.HashMap.put(HashMap.java:436)
      at com.google.maps.api.android.lib6.gmm6.util.e.b(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040408-197041431):17)
      at com.google.maps.api.android.lib6.gmm6.indoor.o.c(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040408-197041431):193)

Fatal Exception: java.lang.StackOverflowError: stack size 8MB
    at java.util.HashMap.get(HashMap.java:556)
    at com.google.maps.api.android.lib6.gmm6.util.e.b(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040408-197041431):7)
    at com.google.maps.api.android.lib6.gmm6.indoor.o.c(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040408-197041431):193)

Fatal Exception: java.lang.StackOverflowError: stack size 1037KB
    at java.util.ArrayList.<init>(ArrayList.java:191)
    at com.google.maps.api.android.lib6.common.i.<init>(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040400-197041431):9)
    at com.google.maps.api.android.lib6.gmm6.indoor.o.b(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040400-197041431):159)
    at com.google.maps.api.android.lib6.gmm6.indoor.o.c(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040400-197041431):161)

Fatal Exception: java.lang.StackOverflowError: stack size 1037KB
    at com.google.maps.api.android.lib6.gmm6.util.e.a(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040400-197041431):5)
    at com.google.maps.api.android.lib6.gmm6.util.e.d(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040400-197041431):33)

Fatal Exception: java.lang.StackOverflowError: stack size 1037KB
       at com.google.maps.api.android.lib6.common.i.<init>(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040400-197041431):9)
       at com.google.maps.api.android.lib6.gmm6.indoor.o.b(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040400-197041431):159)

Fatal Exception: java.lang.StackOverflowError: stack size 1037KB
      at java.util.HashMap.putVal(HashMap.java:630)
      at java.util.HashMap.put(HashMap.java:611)
      at com.google.maps.api.android.lib6.gmm6.util.e.b(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040400-197041431):17)
      at com.google.maps.api.android.lib6.gmm6.indoor.o.c(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040400-197041431):193)

Fatal Exception: java.lang.StackOverflowError: stack size 1037KB
     at java.util.HashMap.remove(HashMap.java:798)
     at com.google.maps.api.android.lib6.gmm6.util.e.d(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040400-197041431):29)
     at com.google.maps.api.android.lib6.gmm6.util.e.a(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040400-197041431):37)

Fatal Exception: java.lang.StackOverflowError: stack size 1036KB
    at java.util.HashMap.get(HashMap.java:300)
    at com.google.maps.api.android.lib6.gmm6.util.e.b(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (020308-197041431):20)
    at com.google.maps.api.android.lib6.gmm6.store.cache.s.a(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (020308-197041431):8)

Fatal Exception: java.lang.StackOverflowError: stack size 1038KB
       at java.util.ArrayList.toArray(ArrayList.java:364)
       at java.util.ArrayList.<init>(ArrayList.java:171)
       at com.google.maps.api.android.lib6.common.i.<init>(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040306-197041431):9)
       at com.google.maps.api.android.lib6.gmm6.indoor.o.b(:com.google.android.gms.dynamite_dynamitemodulesb@[email protected] (040306-197041431):159)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

After trying multiple things, the following is a workaround that worked for me, if you don't require indoor mapping.

// Kotlin
googleMap.isIndoorEnabled = false

// Java
googleMap.setIndoorEnabled(false);

All the crashes I was seeing were related to the indoor package, so this makes some sense. Hopefully, a fix is released soon. Will post if the issue on AOSP tracker is solved.

Update

Good news. Google marked the bug as Fixed on October 20, 2018. Also it was mentioned in release notes of latest Maps Android SDK in Google Play Services

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...