Skip to main content
On this page

Fix common iOS build errors in VS Code, like No such module

What to do when the project isn't found, a build fails, running on a device fails, completion is missing or settings won't save.

Last updated

To fix common iOS build errors in VS Code, start with KXApp's three log channels, all in the drop-down at the top right of the Output panel: kxapp (the extension), kxapp Build (builds) and kxapp Console (app output). Below are fixes by symptom: the project view missing, failed builds, device runs failing, missing completion and project settings that won't save. If nothing helps, attach all three channels to a GitHub issue.

Why doesn't the Xcode Project view appear?

  • The opened folder must contain a .xcodeproj or .xcworkspace. Projects under node_modules, Pods, build or DerivedData are ignored.
  • Run xcode-select -p; it should point inside Xcode.app. If it prints CommandLineTools, run sudo xcode-select -s /Applications/Xcode.app.
  • Open a freshly installed Xcode once to install its components and accept the license.

What do I do when an iOS build fails in VS Code?

  • Start with the first error in the Problems panel and Output › kxapp Build. Whether the same project builds in Xcode tells you if the problem is the project or the extension.
  • Signing errors (No profiles for…, Signing requires a development team): sign in with your Apple ID in Xcode › Settings › Accounts and choose a Team under the target's Signing & Capabilities.
  • CocoaPods modules not found: make sure the .xcworkspace is used and pod install has run.
  • Suspect stale products: Clean Build Folder, then build again.

Why does running or debugging on an iPhone fail?

SymptomFix
The device isn't listedTry another cable or USB port, unlock the device and tap Trust, then Refresh Devices
The device is marked Developer Mode offTurn it on in Settings › Privacy & Security › Developer Mode and restart
The device is lockedUnlock it and run again
Breakpoints take ages and a "device not prepared" message appearsOpen Xcode's Window › Devices and Simulators, connect the device once and wait for it to finish preparing
The app quits immediately or the debugger can't attachCheck the app's last output in Output › kxapp Console; run it from Xcode to see whether the app itself is the problem

Why is there no completion, or "No such module"?

  • Packages and Pods need a build first. Wait a few seconds for the background build, or press Cmd+B once.
  • If the buildServer.json at the workspace root belongs to another build server, the extension doesn't take over. Delete it and reload the window.
  • Still wrong? Run "kxapp: Restart Code Completion" or "kxapp: Re-Index Project".
  • With clangd or another C / Objective-C language extension installed, both answer at once. Disable one, or remove those languages from kxapp.swiftSourcekitLspSupportedLanguages.

How completion works and the settings behind it are in Swift code completion in VS Code.

Why won't project settings save?

Writing project.pbxproj needs Ruby's xcodeproj gem. If ruby -e 'require "xcodeproj"' fails in Terminal, run the "Install the xcodeproj Ruby gem" command or gem install --user-install xcodeproj. If you manage Ruby with rbenv or rvm, put that ruby's path in kxapp.rubyPath.

If these steps don't clear your iOS build errors in VS Code, attach the kxapp, kxapp Build and kxapp Console channels to a GitHub issue, with your Xcode version and the step that fails.

Frequently asked questions

Which Xcode versions does KXApp support?

Xcode 16 or later, installed on your Mac and opened at least once. A freshly installed Xcode must finish installing its components and have its license accepted.

It builds in Xcode but not in VS Code. What should I check first?

Run xcode-select -p and make sure it points to the Xcode.app you use, not CommandLineTools. Then compare with the first error in Output › kxapp Build.

Are provisioning profiles created automatically for device builds?

Yes. kxapp.build.allowProvisioningUpdates is on by default, letting Xcode create or update profiles for device builds, as long as you're signed in under Xcode › Settings › Accounts and a Team is chosen.

CocoaPods modules aren't found. What do I do?

Make sure you opened the .xcworkspace and ran pod install in the project folder, then press Cmd+B once so Pods get completion.

Next steps