Xcode 9: Swift Dependency Analysis Error

Xcode 9: Swift dependency analysis error

It tells that you need to specify the swift version in Build Settings. Just click project and go to Build settings (not the target) and set "Swift Language Version" to Swift 3.2 or Swift 4. Here you have an screenshot :)

Sample Image

Build error, dependency in target requires explicit declaration

Actually the error message already tells you what you have to do:

add

.product(name: "NordicMesh", package: "IOS-nRF-Mesh-Library") 

to the dependencies array:

    ... dependencies: [
.product(name: "NordicMesh", package: "IOS-nRF-Mesh-Library") //<<< like this
//other dependencies
]),

Xcode 13 error: input file [...] was modified during the build

I'm debugging a similar issue in R.swift, I think I've found the cause of the issue.

Xcode 13 appears to execute Run Script build phases during index builds. This can cause a file to be written to by an index pass, in parallel with a build.

To check if this is happening for you, add this to your build script: say $ACTION

On Xcode 12, it only says "build", but in Xcode 13 I hear it saying "indexbuild" during compilation, whenever I save .swift files or otherwise navigate through my code.

To prevent your script from running during indexing, add this check:

if [ $ACTION != "indexbuild" ]; then
# your script here
fi

The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift

The error is pretty clear.

  • In the project navigator select the (blue) project
  • Select the target which uses Swift
  • Click on Build Settings
  • Scroll down to Swift Language Version or in the search field type Swift L
  • In the popup of the setting select the language version


Related Topics



Leave a reply



Submit