Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch ObjectDisposedException in IconTintColorBehavior #2099

Merged
merged 4 commits into from
Aug 8, 2024

Conversation

Kay-STL
Copy link
Contributor

@Kay-STL Kay-STL commented Aug 7, 2024

Description of Change

Related to the last PR for this issue (#2012). This PR explicitly catches ObjectDisposedException in the same way as TouchBehavior. Not an optimal solution, but it's a simple fix and makes absolutely sure that it won't crash the app.

Linked Issues

PR Checklist

  • Has a linked Issue, and the Issue has been approved(bug) or Championed (feature/proposal)
  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Documentation created or updated: https://github.com/MicrosoftDocs/CommunityToolkit/pulls

Additional information

Android only, occurs in a production application. After the previous PR the crash couldn't be reproduced, but a few occurrences were spotted in error reporting.

Copy link
Collaborator

@brminnick brminnick left a comment

Choose a reason for hiding this comment

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

Thanks! Let's just remove these comments so we don't accidentally confuse devs in their traces.

@brminnick brminnick enabled auto-merge (squash) August 8, 2024 01:27
@Kay-STL
Copy link
Contributor Author

Kay-STL commented Aug 8, 2024

Looks like the pipeline is broken - fails every time with:

ILLINK : warning MT0079: The recommended Xcode version for Microsoft.MacCatalyst 17.5.8018 is Xcode 15.4 or later. The current Xcode version (found in /Applications/Xcode_15.2.0.app/Contents/Developer) is 15.2. [/Users/runner/work/1/s/samples/CommunityToolkit.Maui.Sample/CommunityToolkit.Maui.Sample.csproj::TargetFramework=net8.0-maccatalyst]
ILLink : unknown error IL7000: An error occured while executing the custom linker steps. Please review the build log for more information. [/Users/runner/work/1/s/samples/CommunityToolkit.Maui.Sample/CommunityToolkit.Maui.Sample.csproj::TargetFramework=net8.0-ios]
ILLINK : error MT0180: This version of Microsoft.iOS requires the iOS 17.5 SDK (shipped with Xcode 15.4). Either upgrade Xcode to get the required header files or set the managed linker behaviour to Link Framework SDKs Only in your project's iOS Build Options > Linker Behavior (to try to avoid the new APIs). [/Users/runner/work/1/s/samples/CommunityToolkit.Maui.Sample/CommunityToolkit.Maui.Sample.csproj::TargetFramework=net8.0-ios]
ILLINK : error MT2301: The linker step 'Setup' failed during processing: This version of Microsoft.iOS requires the iOS 17.5 SDK (shipped with Xcode 15.4). Either upgrade Xcode to get the required header files or set the managed linker behaviour to Link Framework SDKs Only in your project's iOS Build Options > Linker Behavior (to try to avoid the new APIs). [/Users/runner/work/1/s/samples/CommunityToolkit.Maui.Sample/CommunityToolkit.Maui.Sample.csproj::TargetFramework=net8.0-ios]
/Users/runner/.nuget/packages/microsoft.net.illink.tasks/8.0.7/build/Microsoft.NET.ILLink.targets(87,5): error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false. [/Users/runner/work/1/s/samples/CommunityToolkit.Maui.Sample/CommunityToolkit.Maui.Sample.csproj::TargetFramework=net8.0-ios]

@Kay-STL
Copy link
Contributor Author

Kay-STL commented Aug 8, 2024

Should auto-merge once #2100 is merged and this branch is synced.

@brminnick brminnick merged commit 4a2166a into CommunityToolkit:main Aug 8, 2024
7 checks passed
@Kay-STL Kay-STL deleted the fix/catchDisposed branch August 11, 2024 20:56
@github-actions github-actions bot locked and limited conversation to collaborators Nov 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] IconTintColorBehavior crash on android.
2 participants