Skip to content

Commit

Permalink
Add Xamarin troubleshooting (getsentry#3878)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-zimerman committed Jul 21, 2021
1 parent 513cb4a commit d22c4e1
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/platforms/dotnet/guides/xamarin/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,41 @@ By calling it, the SDK will not automatically Cache your events and they might b

Disables the automatic Logging of internal Warnings that comes from Xamarin Forms.

## Troubleshooting

If you need help solving issues with your Sentry's Xamarin SDK, you can read the edge cases documented here. If you need additional help, you can view our forums, and customers on a paid plan may also contact support.

### Offline Caching Information

For users on Xamarin iOS, offline caching may cause this tricky issue.

#### Event/Transaction Capture - `Failed to send cached envelope: System.MissingMethodException: Method not found: System.Text.Json.JsonDocument`

If this message displays when capturing an event or transaction on your debug window, manually edit your platform `csproj`:

1. Close your IDE
2. Open your iOS `.csproj` with a text or xml editor
3. Add the following NuGet reference:
```xml
<PackageReference Include="System.Memory" IncludeAssets="None">
<Version>4.5.4</Version>
</PackageReference>
```
<Note>

It's important to add the `IncludeAssets` as `None`, otherwise this fix will not work.

</Note>

4. Save and open your IDE
5. Wait for the IDE to restore the packages. Once finished, try to capture an exception or transaction


Another way to validate if the problem is happening on an iOS project, is by adding the following code to your iOS project to check if there's a conflict:
```csharp
_ = new byte[2].AsMemory();
```

## Samples

- An [example](https://github.com/getsentry/sentry-xamarin/tree/main/Samples) using Xamarin Forms and most of the SDK features. (**Android, iOS, UWP**)

0 comments on commit d22c4e1

Please sign in to comment.