wishkit / wishkit-ios

In-App Feature Requests. Made Easy.
https://wishkit.io
MIT License
121 stars 23 forks source link

Package breaks previews on Apple Watch #48

Open ChristianSko opened 5 months ago

ChristianSko commented 5 months ago

Description I am encountering a compilation issue when using the package, specifically using the Apple Watch. Setting up the swift package on the iPhone target disrupts the preview functionality on the Apple Watch.

Steps to Reproduce:

  1. Create a new WatchOS project with an iOS companion app.
  2. Import the WatchKit package into the iOS phone target.
  3. Attempt to load a preview on the Apple Watch simulator or device.
  4. The compilation fails with errors error, and the preview does not load.

Expected Behavior: Importing the package into the phone target should not affect the ability to compile and preview the app on the Apple Watch.

Current Workaround: Currently, I am bypassing this issue by removing the WatchKit package and commenting out the import statement in the phone target. However, this workaround is cumbersome.

Request: It seems like this could potentially be resolved with a quick fix, possibly by adjusting @available attribute configurations to ensure compatibility across targets. Any guidance if I'm doing something wrong would be greatly appreciated.

image
bircni commented 4 months ago

I have the same issue, there is already a report on Apples Site - the workaround mentioned works:

https://developer.apple.com/forums/thread/743957

ChristianSko commented 2 months ago

Thanks @bircni, that's a lot better as a workaround.