alexrainman / ModernHttpClient

ModernHttpClient
MIT License
126 stars 27 forks source link

Cannot access a disposed object. Object name: 'Square.OkHttp3.OkHttpClient'. #77

Open desaishrey90 opened 3 years ago

desaishrey90 commented 3 years ago

I am seeing the following exception occurring often in Android 9.0 devices. It was not occurring in v 3.4.2 of the package. There was an update made for OkHttp3 nuget package in v 3.4.3. Is that causing this?

System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Square.OkHttp3.OkHttpClient'. at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in :0 at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in :0 at Square.OkHttp3.OkHttpClient.CookieJar () [0x0000a] in <33fa226edb0e455ab4097ae9978172a6>:0 at ModernHttpClient.NativeMessageHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x001ad] in <1b85d0c61a414b069649f869d567f362>:0

alexrainman commented 3 years ago

Let me try to reproduce the issue.