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

MAUI+Android: Error when disposing HttpResponseMessage #69464

Open
JamesNK opened this issue May 17, 2022 · 14 comments
Open

MAUI+Android: Error when disposing HttpResponseMessage #69464

JamesNK opened this issue May 17, 2022 · 14 comments

Comments

@JamesNK
Copy link
Member

JamesNK commented May 17, 2022

Description

An HttpResponseMessage can be disposed while an HTTP request is in-progress. This cancels the HTTP request in the client and a notification is sent to the server that its been canceled.

User reported error of this failing in MAUI+Android.

Reproduction Steps

See grpc/grpc-dotnet#1726

Expected behavior

The client cancels the HTTP request and a notification is sent to the server that it's been canceled.

Actual behavior

Exception thrown on Android:

[DOTNET] System.AggregateException: One or more errors occurred. (Unbalanced enter/exit)
[DOTNET]  ---> Java.Lang.IllegalStateException: Unbalanced enter/exit
[DOTNET]    at Java.Interop.JniEnvironment.InstanceMethods.CallVoidMethod(JniObjectReference instance, JniMethodInfo method, JniArgumentValue* args) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:line 11884
[DOTNET]    at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod(String encodedMember, IJavaPeerable self, JniArgumentValue* parameters) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:line 29
[DOTNET]    at Java.IO.InputStream.Close() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net6.0/android-32/mcw/Java.IO.InputStream.cs:line 106
[DOTNET]    at Android.Runtime.InputStreamInvoker.Close() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/InputStreamInvoker.cs:line 62
[DOTNET]    at System.IO.Stream.Dispose()
[DOTNET]    at System.IO.BufferedStream.Dispose(Boolean disposing)
[DOTNET]    at System.IO.Stream.Close()
[DOTNET]    at System.IO.Stream.Dispose()
[DOTNET]    at System.Net.Http.StreamContent.Dispose(Boolean disposing)
[DOTNET]    at System.Net.Http.HttpContent.Dispose()
[DOTNET]    at Grpc.Net.Client.Web.Internal.GrpcWebResponseContent.Dispose(Boolean disposing) in /_/src/Grpc.Net.Client.Web/Internal/GrpcWebResponseContent.cs:line 86
[DOTNET]    at System.Net.Http.HttpContent.Dispose()
[DOTNET]    at System.Net.Http.HttpResponseMessage.Dispose(Boolean disposing)
[DOTNET]    at Xamarin.Android.Net.AndroidHttpResponseMessage.Dispose(Boolean disposing) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Xamarin.Android.Net/AndroidHttpResponseMessage.cs:line 55
[DOTNET]    at System.Net.Http.HttpResponseMessage.Dispose()
[DOTNET]    at Grpc.Net.Client.Internal.GrpcCall`2[[GRPCMagicalSmartHomeServices.WriteData, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[GRPCMagicalSmartHomeServices.StateResponse, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].CancelCall(Status status) in /_/src/Grpc.Net.Client/Internal/GrpcCall.cs:line 429
[DOTNET]    at Grpc.Net.Client.Internal.GrpcCall`2[[GRPCMagicalSmartHomeServices.WriteData, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[GRPCMagicalSmartHomeServices.StateResponse, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].CancelCallFromCancellationToken() in /_/src/Grpc.Net.Client/Internal/GrpcCall.cs:line 402
[DOTNET]    at Grpc.Net.Client.Internal.GrpcCall`2.<>c[[GRPCMagicalSmartHomeServices.WriteData, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[GRPCMagicalSmartHomeServices.StateResponse, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<TryRegisterCancellation>b__69_0(Object state) in /_/src/Grpc.Net.Client/Internal/GrpcCall.cs:line 389
[DOTNET]    at System.Threading.CancellationTokenSource.Invoke(Delegate d, Object state, CancellationTokenSource source)
[DOTNET]    at System.Threading.CancellationTokenSource.CallbackNode.<>c.<ExecuteCallback>b__9_0(Object s)
[DOTNET]    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
[DOTNET] --- End of stack trace from previous location ---
[DOTNET]    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
[DOTNET]    at System.Threading.CancellationTokenSource.CallbackNode.ExecuteCallback()
[DOTNET]    at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
[DOTNET]   --- End of managed Java.Lang.IllegalStateException stack trace ---
[DOTNET] java.lang.IllegalStateException: Unbalanced enter/exit
[DOTNET] 	at com.android.okhttp.okio.AsyncTimeout.enter(AsyncTimeout.java:64)
[DOTNET] 	at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:211)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:307)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:301)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:197)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.readChunkSize(Http1xStream.java:453)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.read(Http1xStream.java:437)
[DOTNET] 	at com.android.okhttp.internal.Util.skipAll(Util.java:165)
[DOTNET] 	at com.android.okhttp.internal.Util.discard(Util.java:147)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.close(Http1xStream.java:474)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.close(RealBufferedSource.java:397)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource$1.close(RealBufferedSource.java:385)
[DOTNET] 	at crc64338477404e88479c.InnerGestureListener.n_onSingleTapUp(Native Method)
[DOTNET] 	at crc64338477404e88479c.InnerGestureListener.onSingleTapUp(InnerGestureListener.java:79)
[DOTNET] 	at android.view.GestureDetector.onTouchEvent(GestureDetector.java:748)
[DOTNET] 	at mono.android.view.View_OnTouchListenerImplementor.n_onTouch(Native Method)
[DOTNET] 	at mono.android.view.View_OnTouchListenerImplementor.onTouch(View_OnTouchListenerImplementor.java:30)
[DOTNET] 	at android.view.View.dispatchTouchEvent(View.java:14536)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3114)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2787)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.WrapperView.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.WrapperView.dispatchTouchEvent(WrapperView.java:98)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:502)
[DOTNET] 	at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1890)
[DOTNET] 	at android.app.Activity.dispatchTouchEvent(Activity.java:4196)
[DOTNET] 	at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
[DOTNET] 	at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:460)
[DOTNET] 	at android.view.View.dispatchPointerEvent(View.java:14799)
[DOTNET] 	at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6347)
[DOTNET] 	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6148)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5626)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
[DOTNET] 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5814)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
[DOTNET] 	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5871)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
[DOTNET] 	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8562)
[DOTNET] 	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8513)
[DOTNET] 	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8482)
[DOTNET] 	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8685)
[DOTNET] 	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
[DOTNET] 	at android.os.MessageQueue.nativePollOnce(Native Method)
[DOTNET] 	at android.os.MessageQueue.next(MessageQueue.java:335)
[DOTNET] 	at android.os.Looper.loopOnce(Looper.java:161)
[DOTNET] 	at android.os.Looper.loop(Looper.java:288)
[DOTNET] 	at android.app.ActivityThread.main(ActivityThread.java:7839)
[DOTNET] 	at java.lang.reflect.Method.invoke(Native Method)
[DOTNET] 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
[DOTNET] 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
[DOTNET]   --- End of managed Java.Lang.IllegalStateException stack trace ---
[DOTNET] java.lang.IllegalStateException: Unbalanced enter/exit
[DOTNET] 	at com.android.okhttp.okio.AsyncTimeout.enter(AsyncTimeout.java:64)
[DOTNET] 	at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:211)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:307)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:301)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:197)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.readChunkSize(Http1xStream.java:453)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.read(Http1xStream.java:437)
[DOTNET] 	at com.android.okhttp.internal.Util.skipAll(Util.java:165)
[DOTNET] 	at com.android.okhttp.internal.Util.discard(Util.java:147)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.close(Http1xStream.java:474)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.close(RealBufferedSource.java:397)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource$1.close(RealBufferedSource.java:385)
[DOTNET] 	at crc64338477404e88479c.InnerGestureListener.n_onSingleTapUp(Native Method)
[DOTNET] 	at crc64338477404e88479c.InnerGestureListener.onSingleTapUp(InnerGestureListener.java:79)
[DOTNET] 	at android.view.GestureDetector.onTouchEvent(GestureDetector.java:748)
[DOTNET] 	at mono.android.view.View_OnTouchListenerImplementor.n_onTouch(Native Method)
[DOTNET] 	at mono.android.view.View_OnTouchListenerImplementor.onTouch(View_OnTouchListenerImplementor.java:30)
[DOTNET] 	at android.view.View.dispatchTouchEvent(View.java:14536)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3114)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2787)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.WrapperView.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.WrapperView.dispatchTouchEvent(WrapperView.java:98)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:502)
[DOTNET] 	at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1890)
[DOTNET] 	at android.app.Activity.dispatchTouchEvent(Activity.java:4196)
[DOTNET] 	at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
[DOTNET] 	at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:460)
[DOTNET] 	at android.view.View.dispatchPointerEvent(View.java:14799)
[DOTNET] 	at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6347)
[DOTNET] 	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6148)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5626)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
[DOTNET] 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5814)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
[DOTNET] 	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5871)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
[DOTNET] 	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8562)
[DOTNET] 	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8513)
[DOTNET] 	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8482)
[DOTNET] 	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8685)
[DOTNET] 	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
[DOTNET] 	at android.os.MessageQueue.nativePollOnce(Native Method)
[DOTNET] 	at android.os.MessageQueue.next(MessageQueue.java:335)
[DOTNET] 	at android.os.Looper.loopOnce(Looper.java:161)
[DOTNET] 	at android.os.Looper.loop(Looper.java:288)
[DOTNET] 	at android.app.ActivityThread.main(ActivityThread.java:7839)
[DOTNET] 	at java.lang.reflect.Method.invoke(Native Method)
[DOTNET] 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
[DOTNET] 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
[DOTNET] 
[DOTNET]    --- End of inner exception stack trace ---
[DOTNET]    at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
[DOTNET]    at System.Threading.CancellationTokenSource.NotifyCancellation(Boolean throwOnFirstException)
[DOTNET]    at System.Threading.CancellationTokenSource.Cancel(Boolean throwOnFirstException)
[DOTNET]    at System.Threading.CancellationTokenSource.Cancel()
[DOTNET]    at MagicalSmartHome.gRPC.Client.Lib.Services.ClientService.DisposeAsy

### Regression?

_No response_

### Known Workarounds

_No response_

### Configuration

_No response_

### Other information

_No response_
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label May 17, 2022
@ghost
Copy link

ghost commented May 17, 2022

Tagging subscribers to 'arch-android': @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

An HttpResponseMessage can be disposed while an HTTP request is in-progress. This cancels the HTTP request in the client and a notification is sent to the server that its been canceled.

User reported error of this failing in MAUI+Android.

Reproduction Steps

See grpc/grpc-dotnet#1726

Expected behavior

The client cancels the HTTP request and a notification is sent to the server that it's been canceled.

Actual behavior

Exception thrown on Android:

[DOTNET] System.AggregateException: One or more errors occurred. (Unbalanced enter/exit)
[DOTNET]  ---> Java.Lang.IllegalStateException: Unbalanced enter/exit
[DOTNET]    at Java.Interop.JniEnvironment.InstanceMethods.CallVoidMethod(JniObjectReference instance, JniMethodInfo method, JniArgumentValue* args) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:line 11884
[DOTNET]    at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod(String encodedMember, IJavaPeerable self, JniArgumentValue* parameters) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:line 29
[DOTNET]    at Java.IO.InputStream.Close() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net6.0/android-32/mcw/Java.IO.InputStream.cs:line 106
[DOTNET]    at Android.Runtime.InputStreamInvoker.Close() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/InputStreamInvoker.cs:line 62
[DOTNET]    at System.IO.Stream.Dispose()
[DOTNET]    at System.IO.BufferedStream.Dispose(Boolean disposing)
[DOTNET]    at System.IO.Stream.Close()
[DOTNET]    at System.IO.Stream.Dispose()
[DOTNET]    at System.Net.Http.StreamContent.Dispose(Boolean disposing)
[DOTNET]    at System.Net.Http.HttpContent.Dispose()
[DOTNET]    at Grpc.Net.Client.Web.Internal.GrpcWebResponseContent.Dispose(Boolean disposing) in /_/src/Grpc.Net.Client.Web/Internal/GrpcWebResponseContent.cs:line 86
[DOTNET]    at System.Net.Http.HttpContent.Dispose()
[DOTNET]    at System.Net.Http.HttpResponseMessage.Dispose(Boolean disposing)
[DOTNET]    at Xamarin.Android.Net.AndroidHttpResponseMessage.Dispose(Boolean disposing) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Xamarin.Android.Net/AndroidHttpResponseMessage.cs:line 55
[DOTNET]    at System.Net.Http.HttpResponseMessage.Dispose()
[DOTNET]    at Grpc.Net.Client.Internal.GrpcCall`2[[GRPCMagicalSmartHomeServices.WriteData, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[GRPCMagicalSmartHomeServices.StateResponse, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].CancelCall(Status status) in /_/src/Grpc.Net.Client/Internal/GrpcCall.cs:line 429
[DOTNET]    at Grpc.Net.Client.Internal.GrpcCall`2[[GRPCMagicalSmartHomeServices.WriteData, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[GRPCMagicalSmartHomeServices.StateResponse, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].CancelCallFromCancellationToken() in /_/src/Grpc.Net.Client/Internal/GrpcCall.cs:line 402
[DOTNET]    at Grpc.Net.Client.Internal.GrpcCall`2.<>c[[GRPCMagicalSmartHomeServices.WriteData, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[GRPCMagicalSmartHomeServices.StateResponse, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<TryRegisterCancellation>b__69_0(Object state) in /_/src/Grpc.Net.Client/Internal/GrpcCall.cs:line 389
[DOTNET]    at System.Threading.CancellationTokenSource.Invoke(Delegate d, Object state, CancellationTokenSource source)
[DOTNET]    at System.Threading.CancellationTokenSource.CallbackNode.<>c.<ExecuteCallback>b__9_0(Object s)
[DOTNET]    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
[DOTNET] --- End of stack trace from previous location ---
[DOTNET]    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
[DOTNET]    at System.Threading.CancellationTokenSource.CallbackNode.ExecuteCallback()
[DOTNET]    at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
[DOTNET]   --- End of managed Java.Lang.IllegalStateException stack trace ---
[DOTNET] java.lang.IllegalStateException: Unbalanced enter/exit
[DOTNET] 	at com.android.okhttp.okio.AsyncTimeout.enter(AsyncTimeout.java:64)
[DOTNET] 	at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:211)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:307)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:301)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:197)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.readChunkSize(Http1xStream.java:453)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.read(Http1xStream.java:437)
[DOTNET] 	at com.android.okhttp.internal.Util.skipAll(Util.java:165)
[DOTNET] 	at com.android.okhttp.internal.Util.discard(Util.java:147)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.close(Http1xStream.java:474)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.close(RealBufferedSource.java:397)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource$1.close(RealBufferedSource.java:385)
[DOTNET] 	at crc64338477404e88479c.InnerGestureListener.n_onSingleTapUp(Native Method)
[DOTNET] 	at crc64338477404e88479c.InnerGestureListener.onSingleTapUp(InnerGestureListener.java:79)
[DOTNET] 	at android.view.GestureDetector.onTouchEvent(GestureDetector.java:748)
[DOTNET] 	at mono.android.view.View_OnTouchListenerImplementor.n_onTouch(Native Method)
[DOTNET] 	at mono.android.view.View_OnTouchListenerImplementor.onTouch(View_OnTouchListenerImplementor.java:30)
[DOTNET] 	at android.view.View.dispatchTouchEvent(View.java:14536)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3114)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2787)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.WrapperView.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.WrapperView.dispatchTouchEvent(WrapperView.java:98)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:502)
[DOTNET] 	at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1890)
[DOTNET] 	at android.app.Activity.dispatchTouchEvent(Activity.java:4196)
[DOTNET] 	at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
[DOTNET] 	at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:460)
[DOTNET] 	at android.view.View.dispatchPointerEvent(View.java:14799)
[DOTNET] 	at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6347)
[DOTNET] 	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6148)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5626)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
[DOTNET] 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5814)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
[DOTNET] 	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5871)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
[DOTNET] 	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8562)
[DOTNET] 	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8513)
[DOTNET] 	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8482)
[DOTNET] 	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8685)
[DOTNET] 	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
[DOTNET] 	at android.os.MessageQueue.nativePollOnce(Native Method)
[DOTNET] 	at android.os.MessageQueue.next(MessageQueue.java:335)
[DOTNET] 	at android.os.Looper.loopOnce(Looper.java:161)
[DOTNET] 	at android.os.Looper.loop(Looper.java:288)
[DOTNET] 	at android.app.ActivityThread.main(ActivityThread.java:7839)
[DOTNET] 	at java.lang.reflect.Method.invoke(Native Method)
[DOTNET] 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
[DOTNET] 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
[DOTNET]   --- End of managed Java.Lang.IllegalStateException stack trace ---
[DOTNET] java.lang.IllegalStateException: Unbalanced enter/exit
[DOTNET] 	at com.android.okhttp.okio.AsyncTimeout.enter(AsyncTimeout.java:64)
[DOTNET] 	at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:211)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:307)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:301)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:197)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.readChunkSize(Http1xStream.java:453)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.read(Http1xStream.java:437)
[DOTNET] 	at com.android.okhttp.internal.Util.skipAll(Util.java:165)
[DOTNET] 	at com.android.okhttp.internal.Util.discard(Util.java:147)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.close(Http1xStream.java:474)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.close(RealBufferedSource.java:397)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource$1.close(RealBufferedSource.java:385)
[DOTNET] 	at crc64338477404e88479c.InnerGestureListener.n_onSingleTapUp(Native Method)
[DOTNET] 	at crc64338477404e88479c.InnerGestureListener.onSingleTapUp(InnerGestureListener.java:79)
[DOTNET] 	at android.view.GestureDetector.onTouchEvent(GestureDetector.java:748)
[DOTNET] 	at mono.android.view.View_OnTouchListenerImplementor.n_onTouch(Native Method)
[DOTNET] 	at mono.android.view.View_OnTouchListenerImplementor.onTouch(View_OnTouchListenerImplementor.java:30)
[DOTNET] 	at android.view.View.dispatchTouchEvent(View.java:14536)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3114)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2787)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.WrapperView.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.WrapperView.dispatchTouchEvent(WrapperView.java:98)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:502)
[DOTNET] 	at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1890)
[DOTNET] 	at android.app.Activity.dispatchTouchEvent(Activity.java:4196)
[DOTNET] 	at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
[DOTNET] 	at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:460)
[DOTNET] 	at android.view.View.dispatchPointerEvent(View.java:14799)
[DOTNET] 	at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6347)
[DOTNET] 	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6148)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5626)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
[DOTNET] 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5814)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
[DOTNET] 	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5871)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
[DOTNET] 	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8562)
[DOTNET] 	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8513)
[DOTNET] 	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8482)
[DOTNET] 	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8685)
[DOTNET] 	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
[DOTNET] 	at android.os.MessageQueue.nativePollOnce(Native Method)
[DOTNET] 	at android.os.MessageQueue.next(MessageQueue.java:335)
[DOTNET] 	at android.os.Looper.loopOnce(Looper.java:161)
[DOTNET] 	at android.os.Looper.loop(Looper.java:288)
[DOTNET] 	at android.app.ActivityThread.main(ActivityThread.java:7839)
[DOTNET] 	at java.lang.reflect.Method.invoke(Native Method)
[DOTNET] 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
[DOTNET] 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
[DOTNET] 
[DOTNET]    --- End of inner exception stack trace ---
[DOTNET]    at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
[DOTNET]    at System.Threading.CancellationTokenSource.NotifyCancellation(Boolean throwOnFirstException)
[DOTNET]    at System.Threading.CancellationTokenSource.Cancel(Boolean throwOnFirstException)
[DOTNET]    at System.Threading.CancellationTokenSource.Cancel()
[DOTNET]    at MagicalSmartHome.gRPC.Client.Lib.Services.ClientService.DisposeAsy

### Regression?

_No response_

### Known Workarounds

_No response_

### Configuration

_No response_

### Other information

_No response_

<table>
  <tr>
    <th align="left">Author:</th>
    <td>JamesNK</td>
  </tr>
  <tr>
    <th align="left">Assignees:</th>
    <td>-</td>
  </tr>
  <tr>
    <th align="left">Labels:</th>
    <td>

`os-android`, `untriaged`

</td>
  </tr>
  <tr>
    <th align="left">Milestone:</th>
    <td>-</td>
  </tr>
</table>
</details>

@ghost
Copy link

ghost commented May 17, 2022

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

An HttpResponseMessage can be disposed while an HTTP request is in-progress. This cancels the HTTP request in the client and a notification is sent to the server that its been canceled.

User reported error of this failing in MAUI+Android.

Reproduction Steps

See grpc/grpc-dotnet#1726

Expected behavior

The client cancels the HTTP request and a notification is sent to the server that it's been canceled.

Actual behavior

Exception thrown on Android:

[DOTNET] System.AggregateException: One or more errors occurred. (Unbalanced enter/exit)
[DOTNET]  ---> Java.Lang.IllegalStateException: Unbalanced enter/exit
[DOTNET]    at Java.Interop.JniEnvironment.InstanceMethods.CallVoidMethod(JniObjectReference instance, JniMethodInfo method, JniArgumentValue* args) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:line 11884
[DOTNET]    at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod(String encodedMember, IJavaPeerable self, JniArgumentValue* parameters) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:line 29
[DOTNET]    at Java.IO.InputStream.Close() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net6.0/android-32/mcw/Java.IO.InputStream.cs:line 106
[DOTNET]    at Android.Runtime.InputStreamInvoker.Close() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/InputStreamInvoker.cs:line 62
[DOTNET]    at System.IO.Stream.Dispose()
[DOTNET]    at System.IO.BufferedStream.Dispose(Boolean disposing)
[DOTNET]    at System.IO.Stream.Close()
[DOTNET]    at System.IO.Stream.Dispose()
[DOTNET]    at System.Net.Http.StreamContent.Dispose(Boolean disposing)
[DOTNET]    at System.Net.Http.HttpContent.Dispose()
[DOTNET]    at Grpc.Net.Client.Web.Internal.GrpcWebResponseContent.Dispose(Boolean disposing) in /_/src/Grpc.Net.Client.Web/Internal/GrpcWebResponseContent.cs:line 86
[DOTNET]    at System.Net.Http.HttpContent.Dispose()
[DOTNET]    at System.Net.Http.HttpResponseMessage.Dispose(Boolean disposing)
[DOTNET]    at Xamarin.Android.Net.AndroidHttpResponseMessage.Dispose(Boolean disposing) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Xamarin.Android.Net/AndroidHttpResponseMessage.cs:line 55
[DOTNET]    at System.Net.Http.HttpResponseMessage.Dispose()
[DOTNET]    at Grpc.Net.Client.Internal.GrpcCall`2[[GRPCMagicalSmartHomeServices.WriteData, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[GRPCMagicalSmartHomeServices.StateResponse, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].CancelCall(Status status) in /_/src/Grpc.Net.Client/Internal/GrpcCall.cs:line 429
[DOTNET]    at Grpc.Net.Client.Internal.GrpcCall`2[[GRPCMagicalSmartHomeServices.WriteData, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[GRPCMagicalSmartHomeServices.StateResponse, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].CancelCallFromCancellationToken() in /_/src/Grpc.Net.Client/Internal/GrpcCall.cs:line 402
[DOTNET]    at Grpc.Net.Client.Internal.GrpcCall`2.<>c[[GRPCMagicalSmartHomeServices.WriteData, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[GRPCMagicalSmartHomeServices.StateResponse, MagicalSmartHome.gRPC.proto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<TryRegisterCancellation>b__69_0(Object state) in /_/src/Grpc.Net.Client/Internal/GrpcCall.cs:line 389
[DOTNET]    at System.Threading.CancellationTokenSource.Invoke(Delegate d, Object state, CancellationTokenSource source)
[DOTNET]    at System.Threading.CancellationTokenSource.CallbackNode.<>c.<ExecuteCallback>b__9_0(Object s)
[DOTNET]    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
[DOTNET] --- End of stack trace from previous location ---
[DOTNET]    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
[DOTNET]    at System.Threading.CancellationTokenSource.CallbackNode.ExecuteCallback()
[DOTNET]    at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
[DOTNET]   --- End of managed Java.Lang.IllegalStateException stack trace ---
[DOTNET] java.lang.IllegalStateException: Unbalanced enter/exit
[DOTNET] 	at com.android.okhttp.okio.AsyncTimeout.enter(AsyncTimeout.java:64)
[DOTNET] 	at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:211)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:307)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:301)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:197)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.readChunkSize(Http1xStream.java:453)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.read(Http1xStream.java:437)
[DOTNET] 	at com.android.okhttp.internal.Util.skipAll(Util.java:165)
[DOTNET] 	at com.android.okhttp.internal.Util.discard(Util.java:147)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.close(Http1xStream.java:474)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.close(RealBufferedSource.java:397)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource$1.close(RealBufferedSource.java:385)
[DOTNET] 	at crc64338477404e88479c.InnerGestureListener.n_onSingleTapUp(Native Method)
[DOTNET] 	at crc64338477404e88479c.InnerGestureListener.onSingleTapUp(InnerGestureListener.java:79)
[DOTNET] 	at android.view.GestureDetector.onTouchEvent(GestureDetector.java:748)
[DOTNET] 	at mono.android.view.View_OnTouchListenerImplementor.n_onTouch(Native Method)
[DOTNET] 	at mono.android.view.View_OnTouchListenerImplementor.onTouch(View_OnTouchListenerImplementor.java:30)
[DOTNET] 	at android.view.View.dispatchTouchEvent(View.java:14536)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3114)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2787)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.WrapperView.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.WrapperView.dispatchTouchEvent(WrapperView.java:98)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:502)
[DOTNET] 	at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1890)
[DOTNET] 	at android.app.Activity.dispatchTouchEvent(Activity.java:4196)
[DOTNET] 	at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
[DOTNET] 	at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:460)
[DOTNET] 	at android.view.View.dispatchPointerEvent(View.java:14799)
[DOTNET] 	at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6347)
[DOTNET] 	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6148)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5626)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
[DOTNET] 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5814)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
[DOTNET] 	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5871)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
[DOTNET] 	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8562)
[DOTNET] 	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8513)
[DOTNET] 	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8482)
[DOTNET] 	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8685)
[DOTNET] 	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
[DOTNET] 	at android.os.MessageQueue.nativePollOnce(Native Method)
[DOTNET] 	at android.os.MessageQueue.next(MessageQueue.java:335)
[DOTNET] 	at android.os.Looper.loopOnce(Looper.java:161)
[DOTNET] 	at android.os.Looper.loop(Looper.java:288)
[DOTNET] 	at android.app.ActivityThread.main(ActivityThread.java:7839)
[DOTNET] 	at java.lang.reflect.Method.invoke(Native Method)
[DOTNET] 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
[DOTNET] 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
[DOTNET]   --- End of managed Java.Lang.IllegalStateException stack trace ---
[DOTNET] java.lang.IllegalStateException: Unbalanced enter/exit
[DOTNET] 	at com.android.okhttp.okio.AsyncTimeout.enter(AsyncTimeout.java:64)
[DOTNET] 	at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:211)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:307)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:301)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:197)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.readChunkSize(Http1xStream.java:453)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.read(Http1xStream.java:437)
[DOTNET] 	at com.android.okhttp.internal.Util.skipAll(Util.java:165)
[DOTNET] 	at com.android.okhttp.internal.Util.discard(Util.java:147)
[DOTNET] 	at com.android.okhttp.internal.http.Http1xStream$ChunkedSource.close(Http1xStream.java:474)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource.close(RealBufferedSource.java:397)
[DOTNET] 	at com.android.okhttp.okio.RealBufferedSource$1.close(RealBufferedSource.java:385)
[DOTNET] 	at crc64338477404e88479c.InnerGestureListener.n_onSingleTapUp(Native Method)
[DOTNET] 	at crc64338477404e88479c.InnerGestureListener.onSingleTapUp(InnerGestureListener.java:79)
[DOTNET] 	at android.view.GestureDetector.onTouchEvent(GestureDetector.java:748)
[DOTNET] 	at mono.android.view.View_OnTouchListenerImplementor.n_onTouch(Native Method)
[DOTNET] 	at mono.android.view.View_OnTouchListenerImplementor.onTouch(View_OnTouchListenerImplementor.java:30)
[DOTNET] 	at android.view.View.dispatchTouchEvent(View.java:14536)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3114)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2787)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.WrapperView.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.WrapperView.dispatchTouchEvent(WrapperView.java:98)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.n_dispatchTouchEvent(Native Method)
[DOTNET] 	at crc6452ffdc5b34af3a0f.LayoutViewGroup.dispatchTouchEvent(LayoutViewGroup.java:56)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
[DOTNET] 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
[DOTNET] 	at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:502)
[DOTNET] 	at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1890)
[DOTNET] 	at android.app.Activity.dispatchTouchEvent(Activity.java:4196)
[DOTNET] 	at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
[DOTNET] 	at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:460)
[DOTNET] 	at android.view.View.dispatchPointerEvent(View.java:14799)
[DOTNET] 	at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6347)
[DOTNET] 	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6148)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5626)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
[DOTNET] 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5814)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
[DOTNET] 	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5871)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
[DOTNET] 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
[DOTNET] 	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8562)
[DOTNET] 	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8513)
[DOTNET] 	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8482)
[DOTNET] 	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8685)
[DOTNET] 	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
[DOTNET] 	at android.os.MessageQueue.nativePollOnce(Native Method)
[DOTNET] 	at android.os.MessageQueue.next(MessageQueue.java:335)
[DOTNET] 	at android.os.Looper.loopOnce(Looper.java:161)
[DOTNET] 	at android.os.Looper.loop(Looper.java:288)
[DOTNET] 	at android.app.ActivityThread.main(ActivityThread.java:7839)
[DOTNET] 	at java.lang.reflect.Method.invoke(Native Method)
[DOTNET] 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
[DOTNET] 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
[DOTNET] 
[DOTNET]    --- End of inner exception stack trace ---
[DOTNET]    at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
[DOTNET]    at System.Threading.CancellationTokenSource.NotifyCancellation(Boolean throwOnFirstException)
[DOTNET]    at System.Threading.CancellationTokenSource.Cancel(Boolean throwOnFirstException)
[DOTNET]    at System.Threading.CancellationTokenSource.Cancel()
[DOTNET]    at MagicalSmartHome.gRPC.Client.Lib.Services.ClientService.DisposeAsy

### Regression?

_No response_

### Known Workarounds

_No response_

### Configuration

_No response_

### Other information

_No response_

<table>
  <tr>
    <th align="left">Author:</th>
    <td>JamesNK</td>
  </tr>
  <tr>
    <th align="left">Assignees:</th>
    <td>-</td>
  </tr>
  <tr>
    <th align="left">Labels:</th>
    <td>

`area-System.Net.Http`, `os-android`, `untriaged`

</td>
  </tr>
  <tr>
    <th align="left">Milestone:</th>
    <td>-</td>
  </tr>
</table>
</details>

@steveisok steveisok added this to the 6.0.x milestone May 17, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label May 17, 2022
@steveisok
Copy link
Member

This looks like the underlying handler is the AndroidNativeHandler.

/cc @simonrozsival

@HausBJB
Copy link

HausBJB commented Jun 22, 2022

Hello, is there anything new?

Many Thanks

@steveisok
Copy link
Member

@simonrozsival can you please validate this is the AndroidMessageHandler? Can you see if sockets would exhibit the same behavior?

@simonrozsival
Copy link
Member

can you please validate this is the AndroidMessageHandler

@steveisok Based on the stack trace in it was the response of AndroidMessageHandler.

Can you see if sockets would exhibit the same behavior?

I wasn't able to reproduce the issue. Either the problem has been fixed in .NET 7 or .NET 8 or my code can't reproduce the issue and I'd need a repro project. @JamesNK were you able to reproduce this issue (I know it's over a year old..)?

@simonrozsival
Copy link
Member

I'm moving the issue to .NET 9 since we won't be able to resolve it in time for .NET 8.

@simonrozsival simonrozsival modified the milestones: 8.0.0, 9.0.0 Aug 7, 2023
@simonrozsival simonrozsival modified the milestones: 9.0.0, Future Feb 13, 2024
@Sergiu-Cosmin
Copy link

@simonrozsival hello, I have tested with .NET 9 preview 3 and I still can reproduce this error, can you tell me when do you expect this to be fixed ?

We have a different scenario, we are using server side events, with Observables, and when we dispose the observable we get the exact same crash in our MAUI app (tried on both version 8.0.10 and 9.0.0-preview.3.10457) only on Android

thank you

@simonrozsival
Copy link
Member

@Sergiu-Cosmin can you share a repro project with me? I wasn't able to reproduce the crash the last time I looked into it and so I wasn't able to fix the problem. If you could help me reproduce the issue, I'm sure we could fix it.

@Sergiu-Cosmin
Copy link

@simonrozsival unfortunately I cannot share it since it is proprietary code, but I will try to make a simple PoC (hope I get the time) to illustrate the issue, thank you

@ssandeepkumar538
Copy link

ssandeepkumar538 commented May 25, 2024

@simonrozsival, @Sergiu-Cosmin, I'm also facing this issue. If you get solution.

Please can you share it here.

Thank you
Sandeep

@simonrozsival
Copy link
Member

This issue is possibly related to dotnet/android#9039

@ederbond
Copy link

I'm still getting it randomly, but very often on my .NET MAUI app.
image

This is how my .MAUI app .csproj looks like
image

This is my workload list

Installed Workload Id      Manifest Version       Installation Source
---------------------------------------------------------------------
maui-windows               8.0.82/8.0.100         VS 17.11.35312.102
maccatalyst                17.5.8030/8.0.100      VS 17.11.35312.102
ios                        17.5.8030/8.0.100      VS 17.11.35312.102
android                    34.0.113/8.0.100       VS 17.11.35312.102
aspire                     8.1.0/8.0.100          VS 17.11.35312.102

And this is the stacktrace when the error occurs.

   at Java.Interop.JniPeerMembers.AssertSelf(IJavaPeerable self) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.cs:line 153
   at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod(String encodedMember, IJavaPeerable self, JniArgumentValue* parameters) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:line 57
   at Java.IO.InputStream.Close() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Java.IO.InputStream.cs:line 116
   at Android.Runtime.InputStreamInvoker.Close() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/InputStreamInvoker.cs:line 62
   at System.IO.Stream.Dispose()
   at System.IO.BufferedStream.Dispose(Boolean disposing)
   at System.IO.Stream.Close()
   at System.IO.Stream.Dispose()
   at System.IO.DelegatingStream.Dispose(Boolean disposing)
   at System.IO.Stream.Close()
   at System.IO.Stream.Dispose()
   at System.Net.Http.Json.HttpContentJsonExtensions.<ReadFromJsonAsyncCore>d__12`1[[System.Collections.Generic.IEnumerable`1[[Doc.Model.User.UserRoleSelection, Doc.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
   at Refit.SystemTextJsonContentSerializer.<FromHttpContentAsync>d__4`1[[System.Collections.Generic.IEnumerable`1[[Doc.Model.User.UserRoleSelection, Doc.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() in c:\temp\releaser\refit\Refit\SystemTextJsonContentSerializer.cs:line 48
   at Refit.RequestBuilderImplementation.<DeserializeContentAsync>d__16`1[[System.Collections.Generic.IEnumerable`1[[Doc.Model.User.UserRoleSelection, Doc.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() in c:\temp\releaser\refit\Refit\RequestBuilderImplementation.cs:line 450
   at Refit.RequestBuilderImplementation.<>c__DisplayClass15_0`2.<<BuildCancellableTaskFuncForMethod>b__0>d[[System.Collections.Generic.IEnumerable`1[[Doc.Model.User.UserRoleSelection, Doc.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Collections.Generic.IEnumerable`1[[Doc.Model.User.UserRoleSelection, Doc.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() in c:\temp\releaser\refit\Refit\RequestBuilderImplementation.cs:line 385

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

7 participants