Skip to content

Troubleshooting

Lukas Pistrol edited this page Sep 23, 2022 · 18 revisions

Troubleshooting

Project does not build

It's possible that the project will not build at first try. This might be due to caching issues of some sort. Please try the following steps in sequential order:

  1. Make sure you are on macOS 12.4 or later as well as Xcode 13.4 or later
  2. Clean the build folder (⇧⌘K)
  3. Reset package caches using File > Packages > Reset Package Caches
  4. Update to latest package versions using File > Packages > Update to latest Package versions
  5. Clear the DerivedData folder which is usually located in ~/Library/Developer/Xcode
  6. Make sure SwiftLint is installed on your machine. See SwiftLint for more information.
  7. Restart Xcode.
  8. Restart your Mac.

If none of the above mentioned steps work please have a chat with us in the help channel on our Discord Server.


SwiftLint

First of all make sure you have SwiftLint installed. To do so simply run brew install swiftlint in your terminal.

Also make sure that SwiftLint is updated. An outdated version can result in false positive error messages.

To update SwiftLint on your machine:

brew update && brew upgrade swiftlint

Trailing Whitespace Violation

This is an error generated by SwiftLint. It means that there are space characters after the last statement of the line. Delete all spaces to get rid of this error.

Trailing Whitespace Violation Error

Recommended: Go to Xcode's Preferences > Text Editing > Editing and enable:

  • Automatically trim trailing whitespace
    • Including whitespace-only lines

Vertical Whitespace Violation

This is an error generated by SwiftLint. It means that there is more than one empty line between to statements. Delete all but one empty lines to get rid of this error.

Vertical Whitespace Violation Error

Recommended: Go to Xcode's Preferences > Text Editing > Editing and enable:

  • Automatically trim trailing whitespace
    • Including whitespace-only lines

SwiftUI Preview Not Working

You may have noticed that SwiftUI does not work out of the box with CodeEdit.

Previews will not work in very large and complicated views such as WorkspaceView

Previews in CodeEditModules

When working on a specific module in CodeEditModules just change the run target to the specific module, then make a clean build and Previews should work instantly.

Select Run Target

Previews in CodeEdit

When working on the main target of CodeEdit it becomes a little more complicated: Go to CodeEdit > Targets > CodeEdit > Signing & Capabilities > Signing.

Select Main Target CodeEdit

There select your personal Team and change the Signing Certificate to Development.

Select Team ID & Signing Certificate

Previews should now work in most views.

Before submitting a PR please change back the Team to None and the Signing Certificate to Sign to Run Locally!