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

Fix for watchOS preview build issue #2412

Closed
wants to merge 1 commit into from
Closed

Fix for watchOS preview build issue #2412

wants to merge 1 commit into from

Conversation

sergeirr
Copy link

@sergeirr sergeirr commented May 21, 2024

For some reason Xcode watchOS SwiftUI preview attempts to build this package against watchOS SDK.

Fixed by adding canImport(QuartzCore) check to all files, it also might be replaced with !os(watchOS).

Tested with:

  • iOS Preview
  • watchOS Preview
  • iOS build
  • watchOS build

Additional info: https://developer.apple.com/forums/thread/731732

Here is an example project to reproduce the issue.
You can try to build this package to "Any watchOS" target as well.
CI check step also can be added to build this package to watchOS target.

Added canImport(QuartzCore) check to all files
@calda
Copy link
Member

calda commented May 21, 2024

Hi @sergeirr, thank you for this detailed bug report and change. Since this is a workaround for a specific watchOS build bug, Lottie explicitly doesn't support watchOS, and this change introduces non-trivial overhead for future changes, I'd prefer we not merge this.

Does this issue only occur when integrating Lottie via SPM? Have you considered integrating Lottie another way, like by directly embedding the Lottie.xframework archive from the latest release? If another integration option doesn't have this issue I'd recommend using that option instead. Also, maintaining a forked repo with this change could be reasonable.

@calda calda closed this May 21, 2024
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.

2 participants