Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Crash for Many Users #1727

Closed
arun-ns opened this issue Oct 5, 2022 · 8 comments
Closed

App Crash for Many Users #1727

arun-ns opened this issue Oct 5, 2022 · 8 comments
Labels
bug 🪲 Something isn't working

Comments

@arun-ns
Copy link

arun-ns commented Oct 5, 2022

Crashes Only in Release APK with MinifyEnabled:true

Fatal Exception: com.mapbox.maps.MapboxStyleException: Add source failed: Source current_location_id already exists
       at com.mapbox.maps.extension.style.sources.Source.bindTo(Source.java:89)
       at com.mapbox.maps.MapboxMap.loadStyle$lambda-8(MapboxMap.java:31)
       at com.mapbox.maps.MapboxMap.$r8$lambda$gb8NbKbZF2nHGNlOyo6Nw1Ys3gg(MapboxMap.java)
       at com.mapbox.maps.MapboxMap$$InternalSyntheticLambda$1$7f54bca300e253fbf079bb77c512220c713911409a93dbfd56a5def85db3ad5e$1.onStyleLoaded(MapboxMap.java:2)
       at com.mapbox.maps.StyleObserver.onStyleSourcesReady(StyleObserver.java:13)
       at com.mapbox.maps.StyleObserver.onStyleDataLoaded(StyleObserver.java:27)
       at com.mapbox.maps.NativeObserver.notify(NativeObserver.java:352)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:335)
       at android.os.Looper.loop(Looper.java:195)
       at android.app.ActivityThread.main(ActivityThread.java:8024)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)

Here is code added in App

  mapView.getMapboxMap().loadStyle(
               style(styleType) {
                   +geoJsonSource("current_location_id") {
                       geometry(getCurrentLocationCircle())
                   }
                   +layerAtPosition(
                       fillLayer("current_location_id", "current_location_id") {
                           fillOpacity(0.3)
                           fillColor("#e51500")
                       },
                   )
               }
           )

@arun-ns arun-ns added the bug 🪲 Something isn't working label Oct 5, 2022
@kiryldz
Copy link
Contributor

kiryldz commented Oct 5, 2022

@arun-ns

  1. can you reproduce this crash locally from your side?
  2. could it be the case that it happens when style is switching from one to another?

@arun-ns
Copy link
Author

arun-ns commented Oct 5, 2022

We couldn't reproduce in locally. We got more than 10k crashes in Firebase Crashlytics @kiryldz

@wen-kai
Copy link

wen-kai commented Oct 11, 2022

we're using rnmapbox which uses mapbox-maps-android under the hood and are also finding very frequent crashes in production. unfortunately the repro is inconsistent and seems to be some sort of race condition. it seems related to dynamic layers:

Exception com.mapbox.maps.MapboxStyleException:
  at com.mapbox.maps.extension.style.layers.Layer.updateProperty (Layer.kt:143)
  at com.mapbox.maps.extension.style.layers.Layer.setProperty$extension_style_release (Layer.kt:132)
  at com.mapbox.maps.extension.style.layers.generated.SymbolLayer.iconImage (SymbolLayer.kt:379)
  at com.mapbox.rctmgl.components.styles.RCTMGLStyleFactory.setIconImage (RCTMGLStyleFactory.java:1322)
  at com.mapbox.rctmgl.components.styles.RCTMGLStyleFactory$3.onAllImagesLoaded (RCTMGLStyleFactory.java:245)
  at com.mapbox.rctmgl.utils.DownloadMapImageTask.onPostExecute (DownloadMapImageTask.kt:128)
  at com.mapbox.rctmgl.utils.DownloadMapImageTask.onPostExecute (DownloadMapImageTask.kt:30)
  at android.os.AsyncTask.finish (AsyncTask.java:695)
  at android.os.AsyncTask.access$600 (AsyncTask.java:180)
  at android.os.AsyncTask$InternalHandler.handleMessage (AsyncTask.java:712)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:7124)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:975)

@orca-nazar
Copy link

@kiryldz Exactly, it happens when the style is switching. However, we use rnmapbox, so there is no way to provide a good example

@kiryldz
Copy link
Contributor

kiryldz commented Oct 31, 2023

@orca-nazar @wen-kai I assume you should then transfer this to rnmapbox repo...
@mfazekas - does this ring a bell perhaps?

@mfazekas
Copy link
Contributor

@kiryldz the iconImage issue we have in @rnmapbox repo - rnmapbox/maps#2289 - was closed as no code to repro was posted there

@orca-nazar
Copy link

Thanks for the responses @kiryldz @mfazekas. After diving deeper into what the source/layer causes the issues on our app, I found a way to reproduce in rnmabox test app. Created a ticket with included all steps rnmapbox/maps#3152

@kiryldz
Copy link
Contributor

kiryldz commented Nov 1, 2023

Closing this one then.

@kiryldz kiryldz closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants