Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

CustomGeometrySource's java peer assertions fail when source is removed #12551

Open
LukasPaczos opened this issue Aug 6, 2018 · 8 comments · Fixed by #15396
Open

CustomGeometrySource's java peer assertions fail when source is removed #12551

LukasPaczos opened this issue Aug 6, 2018 · 8 comments · Fixed by #15396
Labels
Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl

Comments

@LukasPaczos
Copy link
Member

Refs #12517 (review).

The java peer assertions for CustomGeometrySource::fetchTile and CustomGeometrySource::cancelTile can fail when we remove the source on the main thread but the requests are still being processed on worker threads.

Temporary workaround - a small delay between removing the layer and removing the source is enough for the worker threads to finish and then we can safely remove the source.

/cc @asheemmamoowala

@LukasPaczos LukasPaczos added Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl labels Aug 6, 2018
@stale stale bot added the archived Archived because of inactivity label Feb 4, 2019
@stale
Copy link

stale bot commented Feb 4, 2019

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Feb 4, 2019
@LukasPaczos LukasPaczos reopened this Feb 5, 2019
@LukasPaczos LukasPaczos removed the archived Archived because of inactivity label Feb 5, 2019
@stale stale bot added the archived Archived because of inactivity label Aug 4, 2019
@stale
Copy link

stale bot commented Aug 4, 2019

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Aug 4, 2019
@LukasPaczos LukasPaczos reopened this Aug 5, 2019
@stale stale bot removed the archived Archived because of inactivity label Aug 5, 2019
@JesseCrocker
Copy link
Contributor

@LukasPaczos Can you tell me if this issue is being worked on? I'm a Mapbox enterprise customer, and this bug is currently blocking shipping my application.

@JesseCrocker
Copy link
Contributor

This is probably not the right fix, but this commit does seem to fix the crashes: trailbehind@a6c8814

@chloekraw
Copy link
Contributor

Thanks for the heads up @JesseCrocker. We'll look into this in next sprint, beginning next week.

@LukasPaczos
Copy link
Member Author

Hey @JesseCrocker, thanks for a suggestion. We've considered that before but didn't pull the trigger because we had a general refactor in mind. Since that didn't happen and is not on a backlog, for now, we might implement this workaround.

@bentomas
Copy link

bentomas commented Feb 1, 2020

I'm not sure this is completely fixed. We have a custom geometry source with tiles that take 1-2 seconds to load. We also provide the ability to change the basemap style. If you change them quickly, or occasionally randomly, we are getting a crash with this error:

JNI DETECTED ERROR IN APPLICATION: can't call boolean com.mapbox.mapboxsdk.style.sources.CustomGeometrySource.isCancelled(int, int, int) on null object
     in call to CallBooleanMethodV
     from void com.mapbox.mapboxsdk.style.sources.CustomGeometrySource.nativeSetTileData(int, int, int, com.mapbox.geojson.FeatureCollection)

Through debugging, we're definitely getting this error after we've changed styles but when there are still tiles being generated.

Should I create a new issue for this?

@andersoncanteiro
Copy link

I am facing the same problem as @bentomas. I already tried the last version Android (9.6.0), but the problem still happening. Also I am enterprise user and I am not able to release the app because of this issue. Do you guys have any workaround or any news about how to fix this?

JNI DETECTED ERROR IN APPLICATION: can't call boolean com.mapbox.mapboxsdk.style.sources.CustomGeometrySource.isCancelled(int, int, int) on null object
in call to CallBooleanMethodV
from void com.mapbox.mapboxsdk.style.sources.CustomGeometrySource.nativeSetTileData(int, int, int, com.mapbox.geojson.FeatureCollection)

@moritzzzzz moritzzzzz reopened this Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl
Projects
None yet
6 participants