Open abenadar opened 3 months ago
Same issue here. At the moment it looks like Sentry is not compatible with Xamarin apps
Same issue here. At the moment it looks like Sentry is not compatible with Xamarin apps
At least not Xamarin apps relying on MAUI essentials rather than Xamarin.Essentials, which looks like a massive oversight to me. I bumped this issue to the customer support as I was in contact with them anyway. Ticket has fallen stale since then. Guess I'll have to look for alternatives.
Hey @abenadar, @kkabala! Sorry about that, this slipped past by us somehow. We're looking into it.
Hi, this SDK is only compatible with Sentry Xamarin but not MAUI. For MAUI we have another SDK that you can check out here: https://docs.sentry.io/platforms/dotnet/guides/maui/ please let us know if the MAUI SDK is working with your project.
@lucas-zimerman Thanks for looking into this.
The MAUI package as documented is not an option for me as I am not using MAUI as a framework, merely its Essentials libraries. However, I can confirm by now that usage of <UseMauiEssentials>true</UseMauiEssentials>
has no bearing on the issue (I recall it clashing with Xamarin.Essentials being a potential cause though).
I am using plain .NET-iOS/.NET-Android with Uno Platform on top, with independent project heads as mentioned above. hence using the plain Sentry.Xamarin seemed as the obvious solution.
Interestingly enough, the exception does not occurr on the Android simulator (haven't tested physical devices yet). ~Though I haven't received a record fromSentrySdk.CaptureMessage
yet~.
Environment
I have three seperate projects each targeting a different platform.
<UseMauiEssentials>true</UseMauiEssentials>
is used for all, but no Maui itself.Most source files lie in a shared project (not a CL) reference by the tree projects.
Steps to Reproduce
Add a call to the SDK in a source file contained in the shared project:
Expected Result
The project builds successfully.
Actual Result
The build fails with a
Xamarin.Essentials.NotImplementedInReferenceAssemblyException
.I could see this appearing if the shared project was a class library which itself had the only reference to Sentry.Xamarin. However, the main projects do contain the reference.
Since the issue is apparently caused by the underlying Xamarin.Essentials reference I was thinking about using the Maui package, but it appears to use Extensions unavailable in a pure Xamarin project.