Forum Xamarin.Android

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Android app Crash from exception Java.Lang.IllegalStateException: Unbalanced enter/exit

fdhsdrfdhsdr USMember ✭✭
edited October 2020 in Xamarin.Android

Hello,

I've built a rather big project in Xamarin android and I get a crash with this exception while connected on a specific Wifi network.

I use ReactiveExtensions (RX.Net) on the project, and FFImageLoading for getting all images through http.

I present here the stack trace:

JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args)
JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters)
InputStream.Close ()
InputStreamInvoker.Close ()
Stream.Dispose ()
(wrapper remoting-invoke-with-check) System.IO.Stream.Dispose()
BufferedStream.Dispose (System.Boolean disposing)
Stream.Close ()
Stream.Dispose ()
(wrapper remoting-invoke-with-check) System.IO.Stream.Dispose()
DelegatingStream.Dispose (System.Boolean disposing)
Stream.Close ()
Stream.Dispose ()
ObjectExtensions.TryDispose (System.IDisposable obj)
DownloadCache+<>c__DisplayClass16_1.b__1 ()
<.cctor>b__26_0 (System.Object obj)
CancellationCallbackInfo.ExecutionContextCallback (System.Object obj)
ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)
ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)
ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state)
CancellationCallbackInfo.ExecuteCallback ()
CancellationTokenSource.CancellationCallbackCoreWork (System.Threading.CancellationCallbackCoreWorkArguments args)
CancellationTokenSource.ExecuteCallbackHandlers (System.Boolean throwOnFirstException)
java.lang.IllegalStateException: Unbalanced enter/exit
com.android.okhttp.okio.AsyncTimeout.enter AsyncTimeout.java:64
com.android.okhttp.okio.AsyncTimeout$2.read AsyncTimeout.java:211
com.android.okhttp.okio.RealBufferedSource.read RealBufferedSource.java:61
com.android.okhttp.internal.http.Http1xStream$FixedLengthSource.read Http1xStream.java:602
com.android.okhttp.internal.Util.skipAll Util.java:177
com.android.okhttp.internal.Util.discard Util.java:159
com.android.okhttp.internal.http.Http1xStream$FixedLengthSource.close Http1xStream.java:619
com.android.okhttp.okio.RealBufferedSource.close RealBufferedSource.java:422
com.android.okhttp.okio.RealBufferedSource$1.close RealBufferedSource.java:410
CancellationTokenSource.ExecuteCallbackHandlers (System.Boolean throwOnFirstException)
CancellationTokenSource.NotifyCancellation (System.Boolean throwOnFirstException)
CancellationTokenSource.Cancel (System.Boolean throwOnFirstException)
CancellationTokenSource.Cancel ()
CancellationTokenSource.TimerCallbackLogic (System.Object obj)
Timer+Scheduler.TimerCB (System.Object o)

I made my google search and got little similar results but not sure if applies on the error above.
Unfortunately I can't post links.

I really do not a have a clue what causes this.
Any help will be highly appreciated.

Thank you!

Best Answer

  • fdhsdrfdhsdr USMember ✭✭
    edited October 2020 Accepted Answer

    Ok, seems it has something to do with FFImageLoading after all.

    Just in case someone else faces the same issue, just search on Github project page of FFImageLoading for issue 1492.

    I can't post links.

Answers

  • fdhsdrfdhsdr USMember ✭✭
    edited October 2020 Accepted Answer

    Ok, seems it has something to do with FFImageLoading after all.

    Just in case someone else faces the same issue, just search on Github project page of FFImageLoading for issue 1492.

    I can't post links.

  • megazoid93megazoid93 Member

    It seems like i have this issue too. Any workarounds you have found? The issue on GitHub suggest to increase the ConnectTimeout?

Sign In or Register to comment.