-
Notifications
You must be signed in to change notification settings - Fork 604
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
@capacitor/geolocation : RuntimeException - java.util.ConcurrentModificationException #1957
Comments
Any news ? |
1 similar comment
Any news ? |
any news ? |
having the same issue, app crashes in the same place as OP is describing. Dump from logcat on crash:
` Capacitor Doctor Latest Dependencies: @capacitor/cli: 6.1.2 Installed Dependencies: @capacitor/cli: 5.5.1 |
It's still a major production issue in our app... 😮💨 |
Bug Report
Plugin(s)
Capacitor Version
Platform(s)
Current Behavior
When the application, which uses the Capacitor Geolocation plugin, is put into the background for a few minutes and then brought back to the foreground, the app crashes with a
java.util.ConcurrentModificationException
. This exception occurs in theGeolocationPlugin.handleOnResume
method, as detailed in the stack trace provided.Exemple of scenario, it is always more or less same
We have lot of crash due to this error in production on our app.
Expected Behavior
The expected behavior is that the app should resume normally from the background without any crash or exception related to the Geolocation plugin.
Additional Context
This issue seems to occur due to modifications in the
HashMap
within theGeolocationPlugin
while iterating over it. This problem surfaces specifically when handling theonResume
lifecycle event in Android.To reproduce
https://github.com/neogenz/capacitor-geolocation-sample
The scenario is simple : on Android app, pass app in background, wait (only some ms is enough) then put it back in foreground -> crash
The issue is really complicated to reproduce. To "force" it, modify
java/com/capacitorjs/plugins/geolocation/GeolocationPlugin.java
and update this code :And I reproduce it more easily on physical device (on virtual too, but it is less frequent)
We have tried a fix with our team but we don't know if it is correct without knowing all context of Geolocation / Capacitor code :
The text was updated successfully, but these errors were encountered: