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 - Unknown network error EOF #103

Closed
dimitri-dev opened this issue May 6, 2024 · 3 comments
Closed

MAUI - Unknown network error EOF #103

dimitri-dev opened this issue May 6, 2024 · 3 comments
Assignees

Comments

@dimitri-dev
Copy link
Contributor

Describe the bug
Segment.Analytics.AnalyticsError
Unknown network error when uploading to url
-> unexpected end of stream on com.android.okhttp.Address@1599a963
-> \n not found: size=0 content=...

To Reproduce
Just occurs in the background while running a .NET 8 (Runtime 8.0.4) MAUI app.
This is just a (relatively) simple native Android and iOS project.

Raw stack trace

Java.IO.IOException: unexpected end of stream on com.android.okhttp.Address@1599a963
?, in int InstanceMethods.CallIntMethod(JniObjectReference, JniMethodInfo, JniArgumentValue*)
?, in int JniInstanceMethods.InvokeVirtualInt32Method(string, IJavaPeerable, JniArgumentValue*)
?, in HttpStatus HttpURLConnection.get_ResponseCode()
?, in Task AndroidMessageHandler.DoProcessRequest(HttpRequestMessage, URL, HttpURLConnection, CancellationToken, RequestRedirectionState)+() => { }
?, in void Task.InnerInvoke()
?, in async Task AndroidMessageHandler.DoProcessRequest(HttpRequestMessage, URL, HttpURLConnection, CancellationToken, RequestRedirectionState)
?, in async Task AndroidMessageHandler.DoSendAsync(HttpRequestMessage, CancellationToken)
System.Net.WebException: unexpected end of stream on com.android.okhttp.Address@1599a963
?, in async Task AndroidMessageHandler.DoSendAsync(HttpRequestMessage, CancellationToken)
?, in async Task HttpClient.SendAsync(HttpRequestMessage)+Core(?)
?, in async Task DefaultHTTPClient.DoPost(string url, byte[] data)
?, in async Task HTTPClient.Upload(byte[] data)

Additional context
Currently using Segment.Analytics.CSharp 2.3.5.0 release.

dimitri-dev added a commit to dimitri-dev/Analytics-CSharp that referenced this issue May 6, 2024
@dimitri-dev
Copy link
Contributor Author

@wenxi-zeng I'm not sure if this is the best way to go about this, but if you can take a look at #104, it should solve this issue as I've already encountered it in MAUI recently.

@wenxi-zeng
Copy link
Contributor

hi @dimitri-dev, thanks for contributing! the pr looks good. we will thoroughly test it on other platforms and then ship it in the next release. in the meanwhile, please write a custom httpclient as a workaround.

@wenxi-zeng
Copy link
Contributor

@dimitri-dev the fix is shipped in the new release 2.4.1. please have a try. thanks again for your contribution

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