Skip to content

Build swift package attempts to build only for MacOs error :no such module 'UIKit' #1361

Closed
@MikePendo

Description

@MikePendo

Describe the bug
I have fetched an iOS package. attempt to run swift build
and had the following error:
error :no such module 'UIKit'
As far as I can see it builds only for Mac so the error makes sense
so I tried some works arounds like:
swift build --arch arm64 -Xswiftc -sdk -Xswiftc /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.1.sdk -Xswiftc -target -Xswiftc arm64-apple-ios18.0
but that has some other errors

To Reproduce
Steps to reproduce the behavior:

  1. clone for instance the following https://github.com/openreplay/ios-tracker I guess it can be any other package
  2. run swift build

Expected behavior
Run swift build successfully to use jump to code in VS code

Environment

  • OS: Sonoma 14.7.2
  • Swift version: 1.115 Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
  • Visual Studio Code version: 1.96.4
  • vscode-swift version: 1.11.4

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions