platform_maps_flutter icon indicating copy to clipboard operation
platform_maps_flutter copied to clipboard

Map keeps crashing my app on Android

Open tmatrai opened this issue 2 years ago • 2 comments

This component keeps crashing my app all the time on Android. On IOS it is crash-free.

My app uses bottom navigation bar. When navigating by it, going back and forward between tabs, app crashed inexpectedly on a page that contains a Gooogle Maps map on Android by your component. It not consistant, sometimes it crashes, sometimes not, anyway it does it very often.

StackTrace: E/AndroidRuntime(13799): FATAL EXCEPTION: GLThread 139 E/AndroidRuntime(13799): Process: com.x.y, PID: 13799 E/AndroidRuntime(13799): java.lang.NullPointerException: Attempt to get length of null array E/AndroidRuntime(13799): at java.nio.ByteBufferAsIntBuffer.put(ByteBufferAsIntBuffer.java:122) E/AndroidRuntime(13799): at com.google.maps.api.android.lib6.gmm6.vector.gl.buffer.n.i(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):2) E/AndroidRuntime(13799): at com.google.maps.api.android.lib6.gmm6.vector.gl.buffer.n.d(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):3) E/AndroidRuntime(13799): at com.google.maps.api.android.lib6.gmm6.vector.gl.drawable.d.s(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):2) E/AndroidRuntime(13799): at com.google.maps.api.android.lib6.gmm6.vector.gl.drawable.ao.s(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):12) E/AndroidRuntime(13799): at com.google.maps.api.android.lib6.gmm6.vector.bz.s(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):29) E/AndroidRuntime(13799): at com.google.maps.api.android.lib6.gmm6.vector.bs.b(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):151) E/AndroidRuntime(13799): at com.google.maps.api.android.lib6.gmm6.vector.av.run(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):48) D/OpenGLRenderer(13799): setSurface called with nullptr D/OpenGLRenderer(13799): setSurface() destroyed EGLSurface D/OpenGLRenderer(13799): destroyEglSurface 3 D/OpenGLRenderer(13799): setSurface called with nullptr I/Process (13799): Sending signal. PID: 13799 SIG: 9 Lost connection to device.

I tried it on 2 physical devices, it happens on both of them:

  • SM A520F (mobile), Android 8.0.0 (API 26)
  • SM A525F (mobile), Android 12 (API 31)

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.0.2, on macOS 12.4 21F79 darwin-x64, locale hu-HU) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] VS Code (version 1.68.1) [✓] Connected device (5 available) [✓] HTTP Host Availability

tmatrai avatar Jun 22 '22 11:06 tmatrai

Did you ever find a solution to this?

dodderss avatar Jul 30 '22 19:07 dodderss

@WilliamD47 @tmatrai The plugin now supports renderer selection, so project-level changes are no longer needed to request the new renderer; see https://pub.dev/packages/google_maps_flutter_android#map-renderer for details. (You will need to add a direct dependency on the google_maps_flutter_android implementation package to use that new API).

smhoz avatar Feb 01 '23 10:02 smhoz