-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
MissingMethodException throws when Capture any event #72
Comments
Sounds like you have a consistent repro if you can just Init and send an event. Would it be possible to strip stuff off of your app (or somehow make it into a repro you can share with us?). |
I will try to make a repo to share with you guys. The problem is our current app is having a lot of dependencies, so i will try to make a new project to see if we can reproduce it. |
Good news is i can reproduce this by cloning my project dependency into a more simple project. Here is the link for the project. https://github.com/unamed000/my-cat-demo/tree/sentry-error (I cloned the dependency for the main PCL project and iOS, so you might need to test it on ios) When you click on a cat in the list view, an error will be printed out like the one i reported |
Turn out, this is a bug from Akavache, i've linked the issue from Akavache to this one. I think Akavache is using the old System.Text.Json somehow. |
After further investigation, we can see this package is conflicting with SQLitePCL.raw package, not Akavache (Akvache is using a dependency to this package). We still don't know why when using SQLitePCL.raw, the wrong System.Text.JSON is used in Sentry package? So any ideas or suggestions to fix this will be really helpful for us to make sentry works in our app. (Because in Xamarin, a lot of people are using sqlite packages) @bruno-garcia |
We're experiencing exactly the same issue. Seems to have started happening when we migrated our apps onto the iOS14 API's (and in turn newer versions of Visual Studio for Mac, .Net SDK, Mono and Xamarin.iOS). We have none of the dependencies cited above as possible conflicts. Our Xamarin.Android project is fine. Seems like this issue with System.Text.Json is happening elsewhere also https://docs.microsoft.com/en-us/answers/questions/302548/jsonserializer-throws-exception-in-xamarinios.html We can consistently repro this in the latest version of VS for Mac: Visual Studio 2019 for Mac: 8.10.1 Would also love to know if anyone has a workaround as this is affecting our ability to monitor errors in production. |
As @lucas-zimerman identified, this issue is discussed on the mono repository: mono/mono#20805 The work around is to add these dependencies directly to the app:
We'll add this to the docs and possibly to the Xamarin SDK directly. |
Adding these 2 dependencies is not solving the issues for me, the error is still there. I think this dependency error is a little different than the one in the above link. |
@huyvuskedulo do you already specify |
@bruno-garcia Yes i did, actually that was the first thing i tried to do, you can try my repo above, and you will be able to reproduce it immediately |
Thanks for the repro. We'll take a look at it |
Thanks @bruno-garcia , let me know if you can find out anything :D |
I'll give a look at it : ) as a workaround, you could try disabling the cache to your Sentry options:
This will disable the log of events/errors offline but also may lead to not registering unhandled exceptions... We'll keep investigating this issue :) |
Hi @lucas-zimerman . Thanks for the workaround, but since offline mode and registering unhandled exceptions are vital in our apps, so we can't ignore that :). We're having a plan for migrating into Sentry, but until these issues are fixed, we can't do it yet. |
Hi @huyvuskedulo . After further investigation, I was able to conclude tha this is a mono issue related to mono/mono#20805 and not with the SDK You can also validate it by adding the following code anywhere into your iOS project: WorkaroundTo solve this, you'll need to unload your iOS project, <PackageReference Include="System.Memory" IncludeAssets="None">
<Version>4.5.4</Version>
</PackageReference>
Note: the parameter IncludeAssets="None" is required otherwise it'll not work. After that, you'll need to reload your project AND Exit your solution (this is silly but Visual Studio will only apply the changes after you restart it) Finally, after a while (took me a minute after the IDE sorted the packages references), you'll notice that the conflict will be sorted out and Sentry will stop throwing the mentioned error in this PR. |
Thanks @lucas-zimerman , the workaround works for me |
Worth adding to the docs under |
The findings from this thread are not on the troubleshooting page. Please let us know if anything else comes up: https://docs.sentry.io/platforms/dotnet/guides/xamarin/troubleshooting/ |
Any ideas why this is happening? If i tried sentry on a completely new app, it's not an issue, but when i used it in my app , this is what happened when trying to send a message
Environment
Which SDK and version?
Sentry.Xamarin 1.0.3
Refit 5.2.4 (i don't know if this is related but this package have a reference to System.Text.Json as well)
Steps to Reproduce
Just Init in my app and attempt to send a message
Expected Result
Should not throw this excpetion
Actual Result
Error: Failed to send cached envelope: System.MissingMethodException: Method not found: System.Text.Json.JsonDocument System.Text.Json.JsonDocument.Parse(System.ReadOnlyMemory`1,System.Text.Json.JsonDocumentOptions)
at Sentry.Protocol.Envelopes.Envelope.DeserializeHeaderAsync (System.IO.Stream stream, System.Threading.CancellationToken cancellationToken) [0x001a1] in //src/Sentry/Envelopes/Envelope.cs:152
at Sentry.Protocol.Envelopes.Envelope.DeserializeAsync (System.IO.Stream stream, System.Threading.CancellationToken cancellationToken) [0x00032] in //src/Sentry/Envelopes/Envelope.cs:164
at Sentry.Internal.Http.CachingTransport.ProcessCacheAsync (System.Threading.CancellationToken cancellationToken) [0x00117] in /_/src/Sentry/Internal/Http/CachingTransport.cs:173 , discarding cached envelope.
The text was updated successfully, but these errors were encountered: