You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/10/14 03:56:18 UTC

[GitHub] [cordova-android] 8bhsolutions commented on issue #924: Crash Report: ConcurrentModificationException

8bhsolutions commented on issue #924:
URL: https://github.com/apache/cordova-android/issues/924#issuecomment-708140472


   @breautek @EinfachHans 
   I've fixed this issue in my own fork.
   
   The issue is caused by cordova plugin's that use different threads to perform there executions. When they complete their action, some times the iterators are changed, causing the `ConcurrentModificationException`.
   Example plugins: Cordova Google Map, Splashscreen, etc...
   
   My initial thought was the using `Collection.synchronizedMap` was sufficient, but the exception still occurs in productions.
   
   Only by wrapping all the for loops inside `synchronized` keyword fixes the issue.
   
   Note the downside of doing this is that your app load may be abit slow as now the plugins different threads need to wait for the threads of another plugin.
   
   The 2 changesets that fix this problem. Feel free to use as you see fit.
   
   https://github.com/8bhsolutions/cordova-android/commit/9d322237108dfdff391f67a9c7c78f9279866417
   https://github.com/8bhsolutions/cordova-android/commit/1841789e1afcba592a20ccf03ddf33149426527f 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org