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

ConcurrentModificationException onPause #630

Open
becvert opened this issue Nov 22, 2023 · 2 comments
Open

ConcurrentModificationException onPause #630

becvert opened this issue Nov 22, 2023 · 2 comments

Comments

@becvert
Copy link

becvert commented Nov 22, 2023

Describe the bug

Exception java.lang.RuntimeException:
  at android.app.ActivityThread.performPauseActivityIfNeeded (ActivityThread.java:5423)
  at android.app.ActivityThread.performPauseActivity (ActivityThread.java:5374)
  at android.app.ActivityThread.handlePauseActivity (ActivityThread.java:5321)
  at android.app.servertransaction.PauseActivityItem.execute (PauseActivityItem.java:53)
  at android.app.servertransaction.ActivityTransactionItem.execute (ActivityTransactionItem.java:45)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2489)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:240)
  at android.os.Looper.loop (Looper.java:351)
  at android.app.ActivityThread.main (ActivityThread.java:8427)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:568)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1041)
Caused by java.util.ConcurrentModificationException:
  at java.util.LinkedHashMap$LinkedHashIterator.nextNode (LinkedHashMap.java:760)
  at java.util.LinkedHashMap$LinkedEntryIterator.next (LinkedHashMap.java:792)
  at java.util.LinkedHashMap$LinkedEntryIterator.next (LinkedHashMap.java:790)
  at admob.plus.cordova.AdMob.onPause (AdMob.kt:227)
  at org.apache.cordova.PluginManager.onPause (PluginManager.java:241)
  at org.apache.cordova.CordovaWebViewImpl.handlePause (CordovaWebViewImpl.java:482)
  at org.apache.cordova.CordovaActivity.onPause (CordovaActivity.java:255)
  at android.app.Activity.performPause (Activity.java:8614)
  at android.app.Instrumentation.callActivityOnPause (Instrumentation.java:1604)
  at android.app.ActivityThread.performPauseActivityIfNeeded (ActivityThread.java:5413)

To Reproduce
I did not reproduce it myself, just noticed it on Google Play Console lately

Additional context
Android SDK 29
Android SDK 33
so far

Thank you

@becvert
Copy link
Author

becvert commented Nov 28, 2023

onDestroy too

Exception java.lang.RuntimeException:
  at android.app.ActivityThread.performDestroyActivity (ActivityThread.java:5176)
  at android.app.ActivityThread.handleDestroyActivity (ActivityThread.java:5195)
  at android.app.servertransaction.DestroyActivityItem.execute (DestroyActivityItem.java:39)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:145)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:70)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2199)
  at android.os.Handler.dispatchMessage (Handler.java:112)
  at android.os.Looper.loop (Looper.java:216)
  at android.app.ActivityThread.main (ActivityThread.java:7625)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:524)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:987)
Caused by java.util.ConcurrentModificationException:
  at java.util.LinkedHashMap$LinkedHashIterator.nextNode (LinkedHashMap.java:760)
  at java.util.LinkedHashMap$LinkedValueIterator.next (LinkedHashMap.java:788)
  at admob.plus.cordova.AdMob.onDestroy (AdMob.kt:208)
  at org.apache.cordova.PluginManager.onDestroy (PluginManager.java:339)
  at org.apache.cordova.CordovaWebViewImpl.handleDestroy (CordovaWebViewImpl.java:531)
  at org.apache.cordova.CordovaActivity.onDestroy (CordovaActivity.java:327)
  at android.app.Activity.performDestroy (Activity.java:7737)
  at android.app.Instrumentation.callActivityOnDestroy (Instrumentation.java:1327)
  at android.app.ActivityThread.performDestroyActivity (ActivityThread.java:5161)

@becvert
Copy link
Author

becvert commented Dec 21, 2023

Since I replaced val ads = synchronizedMap(mutableMapOf<String, AdBase>())] in ExecuteContext.kt
with ConcurrentHashMap I don't see the above exceptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant