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

Bugsnag does not compile for visionOS with Xcode 15 Beta 2 #1567

Closed
marcpalmer opened this issue Jun 22, 2023 · 2 comments
Closed

Bugsnag does not compile for visionOS with Xcode 15 Beta 2 #1567

marcpalmer opened this issue Jun 22, 2023 · 2 comments
Labels
duplicate Closed as feature/bug is a duplicate

Comments

@marcpalmer
Copy link

marcpalmer commented Jun 22, 2023

Describe the bug

You cannot compile a target for visionOS if it imports Bugsnag as a dependency.

This is because Bugsnag uses #if TARGET_OS_IOS in many places and Apple has "changed the meaning" of this in the sense it cannot be used to identify builds for iOS devices only. It identifies that it is an iOS-like platform, and Bugsnag is gating some code using this that is not valid on visionOS.

Steps to reproduce

  1. In Xcode 15b2, Open an iOS project that uses Bugsnag via SPM
  2. Go to the app target and go to General > Supported Destinations
  3. Remove the "visionOS (Designed for iPad)" destination if present
  4. Add a "visionOS" destination.
  5. Agree to the suggested changes
  6. Build project
  7. You will see compile errors about endGeneratingDeviceOrientationNotifications being unavailable in visionOS

Environment

  • Bugsnag version: 6.27.0
  • iOS/tvOS/macOS version(s): visionOS 1.0 beta
  • Simulator or physical device: Simulator
  • Xcode version: 15.0 Beta 2

Explanation

This causes an issue with this code in BugsnagClient specifically when building for visionOS:

#if TARGET_OS_IOS
    [[UIDEVICE currentDevice] endGeneratingDeviceOrientationNotifications];
#endif
}

This endGeneratingDeviceOrientationNotifications API is not available at all on visionOS so it will not compile.

The solution provided by Apple engineers is to check that TARGET_OS_XR is not also set, something like:

#if TARGET_OS_IOS && !TARGET_OS_XR
    [[UIDEVICE currentDevice] endGeneratingDeviceOrientationNotifications];
#endif
}
@johnkiely1
Copy link
Member

Hi @marcpalmer. Thanks for raising. It is something we are aware of and currently discussing, I'm going to close this in favour of #1565 which I believe is a duplicate of exactly what you are suggesting.

@johnkiely1 johnkiely1 added the duplicate Closed as feature/bug is a duplicate label Jun 23, 2023
@marcpalmer
Copy link
Author

Thanks @johnkiely1 I added a comment there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Closed as feature/bug is a duplicate
Projects
None yet
Development

No branches or pull requests

2 participants