You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Hi, this issue doesn't seem to be related to the VS Code Extension for Swift, but instead looks like a build configuration error. The swift build command is provided by the swift binaries included in your Swift Toolchain; If you still think this is an issue you could create an issue in the swift-package-manager repository with detailed reproduction steps or a sample project.
Hi @MikePendo thanks for reporting this. Just to add to what Paul mentioned, I think what's happening here is that by default the toolchain is set to macOS. In the latest version of the extension (version 2.0.0 onwards, which should be released shortly), you will able to do a Cmd+Shift+P, then Swift: Select target platform and select the iOS toolchain. This should pass in the right flags.
#1335 will also have to be fixed, but until then you'll have to set the Swift.SDK setting to arm64-apple-ios. This should allow you to use features like 'Go to definition' in the code without having to do a swift build.
Hi
Thanks of quick response @plemarquand , @rbenegal,
in your documentation you specify how to build it, and swift build will not build any iOS package as far as I can see (discussion ), so how do we suppose to use this extension in that case?
I mean if your extension is heavily dependent of swift build which doesnt support iOS it basically means that your extension will not work for any iOS package? in that case maybe its worth to mention that this extension for macOS only?
Are there any work around you can recommend for now?
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:
swift build
Expected behavior
Run swift build successfully to use jump to code in VS code
Environment
Thanks
The text was updated successfully, but these errors were encountered: