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

Java.Lang.IllegalStateException: Unbalanced enter/exit on Android #41

Open
jhovelnu opened this issue Jun 27, 2024 · 2 comments
Open

Java.Lang.IllegalStateException: Unbalanced enter/exit on Android #41

jhovelnu opened this issue Jun 27, 2024 · 2 comments

Comments

@jhovelnu
Copy link

jhovelnu commented Jun 27, 2024

Description

Net MAUI Android app crash with error:

Java.Interop.JniEnvironment.InstanceMethods.CallVoidMethod(JniObjectReference , JniMethodInfo , JniArgumentValue* )
Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod(String , IJavaPeerable , JniArgumentValue* )
Java.IO.InputStream.Close()
Android.Runtime.InputStreamInvoker.Close()
System.IO.Stream.Dispose()
System.IO.BufferedStream.Dispose(Boolean )
System.IO.Stream.Close()
System.IO.Stream.Dispose()
System.IO.DelegatingStream.Dispose(Boolean )
System.IO.Stream.Close()
System.IO.Stream.Dispose()
FFImageLoading.ObjectExtensions.TryDispose(IDisposable obj)
FFImageLoading.Cache.DownloadCache.<>c__DisplayClass23_1.b__1()
System.Threading.CancellationToken.<>c.b__12_0(Object obj)
System.Threading.CancellationTokenSource.Invoke(Delegate , Object , CancellationTokenSource )
System.Threading.CancellationTokenSource.CallbackNode.<>c.b__9_0(Object s)
System.Threading.ExecutionContext.RunInternal(ExecutionContext , ContextCallback , Object )
System.Threading.ExecutionContext.RunInternal(ExecutionContext , ContextCallback , Object )
System.Threading.CancellationTokenSource.CallbackNode.ExecuteCallback()
System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean )
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:51
com.android.okhttp.internal.http.Http1xStream$FixedLengthSource.read Http1xStream.java:395
com.android.okhttp.internal.Util.skipAll Util.java:165
com.android.okhttp.internal.Util.discard Util.java:147
com.android.okhttp.internal.http.Http1xStream$FixedLengthSource.close Http1xStream.java:412
com.android.okhttp.okio.RealBufferedSource.close RealBufferedSource.java:397
com.android.okhttp.okio.RealBufferedSource$1.close RealBufferedSource.java:385

Java.Lang.IllegalStateException: Unbalanced enter/exit on Android

Steps to Reproduce

1 - Create a Net Maui Project
2 - Implement the FFimageloading
3 - Set image source from external url
4 - Sometimes the app crashes

Expected Behavior

App working well

Actual Behavior

The app crashes

Basic Information

  • Version with issue: 1.2.3
  • Last known good version: N/A
  • Platform: Android

This same issue was reported for Xamarin forms: luberda-molinet/FFImageLoading#1492

This Screenshot is from app center where all the exceptions are logged

image

@microspaze
Copy link
Owner

@jhovelnu I think I had already fixed this issue by 1.2.4 (For fix Android app crashes when using using multiple CachedImage for showing multiple gifs #35). You can try the latest version to verify it.

@jhovelnu
Copy link
Author

Hi @microspaze with the new version 1.2.4 this error was fixed!

Thanks!!!

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

No branches or pull requests

2 participants