Comments (18)
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:
var x = new byte[2].AsMemory();
You'll notice that you'll get the following error message
that happens because mono implements the extension AsMemory and other nuget (like the SqlLite one) also uses the System.Memory, causing the conflict.
Workaround
To solve this, you'll need to unload your iOS project,
Edit or replace the System.Memory reference by:
<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.
from sentry-xamarin.
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.
from sentry-xamarin.
Thanks @lucas-zimerman , the workaround works for me
from sentry-xamarin.
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?).
That would really help us debug this.
from sentry-xamarin.
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.
from sentry-xamarin.
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
from sentry-xamarin.
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
from sentry-xamarin.
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
Mono Framework MDK: 6.12.0.140
.NET Core SDK: 5.0.301
Xcode: 12.5
Xamarin.iOS: 14.20.0.3
Would also love to know if anyone has a workaround as this is affecting our ability to monitor errors in production.
from sentry-xamarin.
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:
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
We'll add this to the docs and possibly to the Xamarin SDK directly.
from sentry-xamarin.
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.
from sentry-xamarin.
@huyvuskedulo do you already specify System.Text.Json
version 5.0.0
directly on your project?
from sentry-xamarin.
@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
from sentry-xamarin.
Thanks for the repro. We'll take a look at it
from sentry-xamarin.
Thanks @bruno-garcia , let me know if you can find out anything :D
from sentry-xamarin.
I'll give a look at it : )
as a workaround, you could try disabling the cache to your Sentry options:
SentryXamarin.Init(ops => {
ops.Debug = true;
ops.Dsn = "...";
ops.AddXamarinFormsIntegration();
ops.DisableOfflineCaching();
});
This will disable the log of events/errors offline but also may lead to not registering unhandled exceptions...
We'll keep investigating this issue :)
from sentry-xamarin.
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.
from sentry-xamarin.
Worth adding to the docs under Troubleshooting
from sentry-xamarin.
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/
from sentry-xamarin.
Related Issues (20)
- Testing automation HOT 1
- Issue with linker: System.MissingMethodException: Constructor on type 'System.Text.Json.Serialization.Converters.DictionaryOfTKeyTValueConverter HOT 1
- Action on Windows-Latest is not working
- add app start instrumentation for xamarin (forms) HOT 6
- add Routing Instumentation for App Shell in Xamarin Forms HOT 1
- add Slow and Frozen Frames instrumentation for xamarin
- Documentation - change DSN to https://[email protected]/1234 HOT 2
- Discuss CancelationToken on FormsApplicationListener HOT 1
- System.AggregateException from Sentry assembly in Xamarin.Droid app HOT 8
- Update to [email protected] with Forms??? HOT 3
- Crash on Self Hosted. HOT 1
- Sentry.Xamarin 1.4.2 gives error when compiling against net6.0-android project HOT 2
- Unhandled Exception : System.IO.IOException: Sharing violation on path ..../Sentry/xxxxx.envelope HOT 7
- Sentry does not work in XamarinForms.iOS apps HOT 8
- SDK doesn't allow you to overwrite the release option
- Line numbers for Android HOT 7
- 1.5+ Breaks using Sentry 3.31 or higher HOT 6
- System.MissingMethodException: Method not found HOT 6
- [BUG] Android caching not working HOT 4
- Define custom page types to be ignored HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-xamarin.