sentry-dotnet
sentry-dotnet copied to clipboard
Maui iOS build error(s): The xcframework sentry.bindings.cocoa\5.10.0\lib\net8.0-ios17.0\Sentry.Bindings.Cocoa.resources.zip has an incorrect or unknown format and cannot be processed.
Package
Sentry
.NET Flavor
.NET
.NET Version
9.0
OS
iOS
OS Version
No response
Development Environment
Visual Studio v17.x
SDK Version
5.10
Self-Hosted Sentry Version
No response
Workload Versions
UseSentry or SentrySdk.Init call
.UseSentry(options =>
{
//The DSN is the only required setting
options.Dsn = **************;
#if DEBUG
options.Debug = true;
options.TracesSampleRate = 1.0;
#else
options.TracesSampleRate = 0.2;
#endif
//All other Sentry options
options.IsGlobalModeEnabled = true;
options.IncludeTextInBreadcrumbs = true;
options.IncludeTitleInBreadcrumbs = true;
options.IncludeBackgroundingStateInBreadcrumbs = true;
options.AttachStacktrace = true;
options.CaptureFailedRequests = true;
});
Steps to Reproduce
- Update Visual Studio to 17.14.6 (June 2025).
- Try and build a Maui app with iOS and/or MacCatalyst platforms included.
Expected Result
Everything should build with no errors.
Actual Result
When trying to build our Maui project we're getting the following 4 errors:
- The xcframework C:\Users******.nuget\packages\sentry.bindings.cocoa\5.10.0\lib\net8.0-ios17.0\Sentry.Bindings.Cocoa.resources.zip has an incorrect or unknown format and cannot be processed.
- Can't process the zip file 'C:\Users******..nuget\packages\sentry.bindings.cocoa\5.10.0\lib\net8.0-maccatalyst17.0\Sentry.Bindings.Cocoa.resources.zip' on this platform: the file 'Sentry-Dynamic.xcframework/ios-arm64_arm64e_x86_64-maccatalyst/Sentry.framework/PrivateHeaders' is a symlink.
- Can't process the zip file 'C:\Users******..nuget\packages\sentry.bindings.cocoa\5.10.0\lib\net8.0-maccatalyst17.0\Sentry.Bindings.Cocoa.resources.zip' on this platform: the file 'Sentry-Dynamic.xcframework/ios-arm64_arm64e_x86_64-maccatalyst/Sentry.framework/Resources' is a symlink.
- The xcframework C:\Users******..nuget\packages\sentry.bindings.cocoa\5.10.0\lib\net8.0-maccatalyst17.0\Sentry.Bindings.Cocoa.resources.zip has an incorrect or unknown format and cannot be processed.
Updating Visual Studio to 17.14.6 (June 2025) is the cause - I guarantee it. Everything built correctly yesterday, but clearly Microsoft have changed something in their Maui compilation that's caused this mismatch with Sentry.
(by the way I am aware of https://docs.sentry.io/platforms/dotnet/guides/maui/troubleshooting/#visual-studio-hot-restart-incompatibility, but I don't have Hot Restart enabled, so that's not a problem, this is definitely caused by the VS update).
Thanks, @WeaverSystems, for the bug report. And thanks for sifting through troubleshooting.
To further help us triaging:
- From which Visual Studio version have you been upgrading from?
v17.13.*or lessv17.14.0or greater
- Does this error only occur when building from Visual Studio
- or does it also occur when trying to build from the .NET SDK (
dotnet build)
- or does it also occur when trying to build from the .NET SDK (
My initial thoughts:
- Could this issue be related to an outdated/incompatible
dotnet workload? - May currently unreleased changes alleviate the issue?
- #4260
- #4272
I'll try to reproduce the issue when I'm back on a Windows machine.
I was upgrading from the previous VS release, so 17.14.5.
I've just tried a CLI build, unfortunately with the same result.
I’m experiencing the same issue. The error only happens when building in Visual Studio 2022. The build works fine in Azure Pipelines. I managed to get it working on the Android emulator by disabling everything related to Hot Reload in VS2022. However, the same problem still occurs when running on the iOS simulator. I’m building from VS2022 on Windows and running the iOS simulator on a Mac. This issue started after I updated VS2022 from version 17.14.5 to 17.14.6.
Tried a CLI build, unfortunately with the same result. And This was after updating Visual Studio to 17.14.6
Just ran into the same problem, I upgraded VS to 17.14.6 Preview 1.0 and xcode to 16.4 and the problem just started.
Thanks for your feedback - this helps a lot.
There may be an issue connected to the bundled .NET SDK 9.0.301 from Visual Studio 17.14.6 on Windows.
I'll be able to test this scenario on my Windows-macOS-Setup over the weekend. And we'll also automate the Windows/Visual-Studio experience to catch related issues in the future earlier: #4299
Could we get info from the Microsoft team about what changed (is there a change log) to help us navigate this?
Did other packages that contain native bindings also break?
Another question: the title says net8.0.
Are the apps targeting net8? Does it work with dotnet 9? I wonder if it's a breaking change with net8 bundling/packaging of native bindings.
I don't think it's net8.0 only, as we also got a report for net9.0: see #4293
@Flash0ver I backed VS Preview back to 17.14.5 Preview 1.0 at ios level 18.4.0.0 and the problem went away. "Sentry.Maui" Version="5.11.0" compiles fine now.
As far as other binding libs, I have two that uses the xcframework and they both compile ok, haven't tested them with the latest upgrade but no compile errors.
Note: I am using .Net 9
Raised:
- https://github.com/dotnet/macios/issues/23101
Thanks @IntegraSysIncJP for the additional reproductions and diagnostics.
@bruno-garcia asked on Discord and this issue seems to originate from dotnet (see mentioned issue above).
We need a minimal sample project and/or a binlog. I'll reproduce the problem when I'm back on my Windows machine to get a binlog. ~But feel free to beat me to it 😉:~
dotnet build -blmsbuild Solution-Or-Project /bl
I'm uncertain whether the current version of MSBuild includes potentially sensitive data per default. Anyway, the BinLog-Viewer can help with redaction: see https://msbuildlog.com/ However, be careful not to accidentally leak any sensitive data.
@bruno-garcia I can confirm that whilst the error messages say .net 8 it is affecting .net 9, as that's what we're using.
Repo with Repro & .binlog: https://github.com/Flash0ver/dotnet-macios-issues-23101
Thanks everybody for helping with the diagnostics!
In the meantime, as a workaround, you may Rollback to the previous version of Visual Studio: See https://devblogs.microsoft.com/visualstudio/introducing-visual-studio-rollback/
Thank you Stefan!
@WeaverSystems, @rad765, @Orgbrat, @kenroencordel, @IntegraSysIncJP. It appears that the issue only occurs when building for Mac Catalyst, but works fine for iOS. As a workaround - until the issue is fixed - you may remove/disable the Mac Catalyst target on Windows for now. See https://github.com/dotnet/macios/issues/23101#issuecomment-2998929627.
I updated to sentry 5.11.2 but I still have the same error on
.nuget\packages\sentry.bindings.cocoa\5.11.2\lib\net8.0-ios17.0\Sentry.Bindings.Cocoa.resources.zip xcframework is incorrect or unknown and cannot be processed.
What I have to do?
I had the same error as @AngeloLazzari using 5.11.2. I tried the fix mentioned by @Flash0ver but it did not work for me.
I don't use MacCatalst so I removed it as a build target in all my .csproj files..
`<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net9.0-android;net9.0-ios</TargetFrameworks>
<!--Removing "net9.0-maccatalyst" above is a workaround for Sentry causing a build error: https://github.com/dotnet/macios/issues/23101#issuecomment-2998929627-->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>`
My project now builds. I tested it on Windows and Android.
@AngeloLazzari, until https://github.com/dotnet/macios/issues/23101 is fixed, you may
- roll back to Visual Studio 17.14.5 or less
- disable Mac Catalyst targets, like @Surfrat did (thanks for sharing your workaround)
ok thanks! Angelo
@Flash0ver how long it will take the fix to arrive? We are not able to downgrade VS because we need to test the app with the last xcode version and we have a big app to send to stores....
@Surfrat thanks for the fix, but if I put that code in the csproj the proyect is not working anymore...
Thank you!
@AngeloLazzari I'm afraid I can't tell. Please refer to https://github.com/dotnet/macios/issues/23101 for the issue's status. And would you mind sharing your MSBuild properties that don't work ... perhaps we can help with the workaround.
@AngeloLazzari You must not add my code to your csproj. Just remove net9.0-maccatalyst from the <TargetFrameworks> section.
Is this being fixed? Apologies if I've missed an update saying so. I'm still on VS 17.4.5 and would like to upgrade soon. Thanks!
@FlashOver - How will today's .NET 9.0.7 affect this situation? I'm Only building for IOS, Android and Windows (no net9.0-maccatalyst).
This has been on-going for 3 weeks? I've been writing code since 1972. Any 100% repeatable bug is a gift from Heaven and Simple to fix??
Is Sentry a viable company with an actual programming staff? For a company with 'Code Breaks, Fix it Faster' as their web banner, this situation has been Very disappointing?
I placed my faith in Sentry mostly due to a @jamesmontemagno recommendation. I just see so little activity here that I'm wondering if I need to explore other options as I now have an important IOS release with Zero logging.
Is this going to be fixed? When? What is the reason for these many weeks without a fix?
@ldl01031 @exquirentibus I think you're both aware of this tracking issue right?
- https://github.com/dotnet/macios/issues/23101
It looks like the issue is in the dotnet repo then (not Sentry)... the best we can do here is offer workarounds (like disabling macatalyst targets).
Or have I misunderstood something?
@ldl01031 @exquirentibus I think you're both aware of this tracking issue right?
It looks like the issue is in the dotnet repo then (not Sentry)... the best we can do here is offer workarounds (like disabling macatalyst targets).
Or have I misunderstood something?
I was not aware of the tracking issue; it's the info I was looking for [and I understand other's frustrations!] Thank you.
@ldl01031 @exquirentibus I think you're both aware of this tracking issue right?
* [Maui iOS build error(s): The xcframework sentry.bindings.cocoa\5.10.0\lib\net8.0-ios17.0\Sentry.Bindings.Cocoa.resources.zip has an incorrect or unknown format and cannot be processed. dotnet/macios#23101](https://github.com/dotnet/macios/issues/23101)It looks like the issue is in the dotnet repo then (not Sentry)... the best we can do here is offer workarounds (like disabling macatalyst targets).
Or have I misunderstood something?
If it's the .NET repo, are there concise steps to go Back to another that will succeed? I tried to do that previously with my AI but was not successful in building?
I'm Only having issues with Sentry. If I remove it (I put steps on that other link last week), I can build And publish IOS.
As .NET builds are in motion for quite some time before they are released, I'd hope that Sentry would be testing and providing feedback (if it Is the build's fault) so that a New build does Not go out that Breaks important features (like Logging)?
@exquirentibus per the issue description:
Revert the Visual Studio version to 17.14.5
Or alternatively, from further down in the conversation, only target maccatalyst when not building on Windows:
<TargetFrameworks>net9.0-android;net9.0-ios</TargetFrameworks>
<TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
@exquirentibus per the issue description:
Revert the Visual Studio version to 17.14.5
Or alternatively, from further down in the conversation, only target maccatalyst when not building on Windows:
<TargetFrameworks>net9.0-android;net9.0-ios</TargetFrameworks> <TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-maccatalyst</TargetFrameworks> <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
MS doesn't really give you the ability to install a particular version of VS? So I don't believe you Can 'revert' to 17.14.5?
I'd tried an older 17.12.1 I kept around. And tried going back to an earlier .NET9.
I'm normally running 17.14.7 (of course there's an Update to that today).
I'm NEVER targeting maccatalyst? Only IOS, Android & Windows?