How can I add ActivityKit extension for iPhone but not Mac in SwiftUI app?

84 Views Asked by At

I have a SwiftUI app that is developed for all iOS devices and silicon Mac OS as well.

I have added ActivityKit Widget for the iOS devices and it works well. But when I submitted to the appStore I got the following error:

ITMS-90863: Macs with Apple silicon support issue - The app links with libraries that aren’t present in macOS:

/System/Library/Frameworks/ActivityKit.framework/ActivityKit

I don't wish to uncheck Mac because this app will be for Mac OS as well as iOS. How can I exclude the widget for only iOS to fix this warning?

1

There are 1 best solutions below

0
OffensivelyBad On

I fixed this issue in my project:

  • In Xcode select the project > your target > Build phases
  • In "Link Binary With Libraries" phase add ActivityKit and WidgetKit if they're not already there
  • Change their statuses to Optional

After those changes I was able to run the iOS app on macOS.