Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jpnurmi
Copy link
Collaborator

@jpnurmi jpnurmi commented Aug 5, 2025

When a consuming app upgrades or downgrades Sentry .NET, it might be left with an incorrect, stale version of the Sentry Cocoa framework in the intermediate output directory.

Sentry .NET Sentry Cocoa
5.5.1 8.39.0
5.6.0 8.46.0
5.7.0 8.46.0
5.8.0 8.39.0

For example, an app built with Sentry .NET 5.5.1 has Sentry Cocoa 8.39 extracted into the intermediate output directory:

./obj/Release/net9.0-ios18.0/iossimulator-arm64/Sentry.Bindings.Cocoa.resources.zip/Sentry-Dynamic.xcframework

When upgraded to Sentry .NET 5.6.0 without cleaning, the intermediate output directory still contains Sentry Cocoa 8.39 instead of 8.46. Similar problems occur when upgrading from Sentry .NET 5.7.0 to 5.8.0 because Sentry.Bindings.Cocoa does not match the stale version of Sentry Cocoa.

This PR tries to fix the problem by changing Sentry.Bindings.Cocoa to reference a versioned framework (Sentry-<version>.xcframework) instead of Sentry-Dynamic.xcframework.

NOTE: The Xamarin tooling automatically takes care of archiving and extracting Sentry.Bindings.Cocoa.resources.zip. It is hard to control the name of the ZIP archive ($(AssemblyName).resources), but we can control the name of Sentry-xxx.xcframework inside.

P.S. Sentry Cocoa bundle version can be checked in Sentry-Dynamic.xcframework/ios-arm64_x64_64-simulator/Sentry.framework/Info.plist.

See also:

#skip-changelog (already released as 5.14.0-alpha.0)

@jpnurmi
Copy link
Collaborator Author

jpnurmi commented Aug 5, 2025

Minimal test app with instructions: https://github.com/jpnurmi/SentryMauiApp

@jpnurmi jpnurmi changed the title fix: version Sentry-Dynamic.xcframework fix: Sentry Cocoa framework version Aug 5, 2025
@jpnurmi jpnurmi marked this pull request as ready for review August 5, 2025 18:54
@jpnurmi
Copy link
Collaborator Author

jpnurmi commented Aug 6, 2025

With Sentry-xxx.xcframework versioned to avoid conflicts, upgrading and downgrading back and forth between these releases works fine:

  • sentry-dotnet 5.14.0-alpha.0 (+ sentry-cocoa 8.39.0)
  • sentry-dotnet 5.14.0-alpha.1 (+ sentry-cocoa 8.46.0)

https://github.com/jpnurmi/SentryMauiApp/actions/runs/16780386537/job/47521803035

Copy link
Collaborator

@jamescrosswell jamescrosswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since all the tests pass, I'm assuming this is good to go.

Thanks @jpnurmi !

@jpnurmi
Copy link
Collaborator Author

jpnurmi commented Aug 12, 2025

Thanks! Yes, this is ready to go, and safe to merge as it only adds a version suffix to the .xcframework.

@jpnurmi jpnurmi merged commit 0405cb2 into main Aug 12, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants