react-native-ssl-pinning
react-native-ssl-pinning copied to clipboard
Fatal Exception: java.util.ConcurrentModificationException
Hi guys, we have a crash in crashlytics with this lib.
The log:
Fatal Exception: java.util.ConcurrentModificationException at java.util.ArrayList$Itr.next(ArrayList.java:860) at okhttp3.internal.http.BridgeInterceptor.cookieHeader(BridgeInterceptor.java:16) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:141) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:118) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:28) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:118) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:9) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:119) at okhttp3.RealCall$AsyncCall.run(RealCall.java:51) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764)
If you have any solution is welcome!
hi, same error happened to me, it seem randomly occurs and cause the app crashed and close.
Try all these method but still failed. https://stackoverflow.com/questions/65094922/error-e-androidruntime-fatal-exception-okhttp-dispatcher-in-using-react-nat
2021-06-01 19:07:24.108 30957-31111/id.myapp E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: id.myapp, PID: 30957
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.next(ArrayList.java:860)
at okhttp3.internal.http.BridgeInterceptor.cookieHeader(BridgeInterceptor.kt:120)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:77)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:71)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:215)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:184)
at okhttp3.RealCall$AsyncCall.run(RealCall.kt:136)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
2021-06-02 21:03:56.300 10079-10237/id.myapp W/id.myapp: Long monitor contention with owner OkHttp https://myapi.org/... (10232) at void org.chromium.android_webview.AwCookieManager.nativeFlushCookieStore()(PG:-2) waiters=2 in void com.toyberman.RNSslPinningModule$1.saveFromResponse(okhttp3.HttpUrl, java.util.List) for 151ms
2021-06-02 21:03:56.369 10079-10255/id.myapp W/id.myapp: Long monitor contention with owner OkHttp Dispatcher (10233) at void com.toyberman.RNSslPinningModule$1.saveFromResponse(okhttp3.HttpUrl, java.util.List)(RNSslPinningModule.java:-1) waiters=2 in java.util.List com.toyberman.RNSslPinningModule$1.loadForRequest(okhttp3.HttpUrl) for 110ms
warning message before hit the FATAL EXCEPTION error, hope this help.
+1
+1 Got the same crash in crashlytics. @EugeneFoo @joelpereda @akimabs or anyone Any solution to this crash?
@Spark-Cybel
In the end I didn't use this plugin, and manually put public key directly in native code.
iOS - https://itnext.io/react-native-security-ssl-pinning-cde086210d58 Android - https://medium.com/@jaedmuva/react-native-ssl-pinning-is-back-e317e6682642
Hope this helps.
Cools Thanks.🙌 I will try this method...