Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 560 Vote(s) - 3.51 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'Build input file cannot be found' Swift 4.2, Xcode 10.0

#1
I am getting the following error when building in Xcode 10.0 with swift 4.2:

[![This is the error][1]][1]


[1]:


Reply

#2
Moving the folders around the inspector can cause the error "Build input file cannot be found"

**SWIFT 5**

In Swift 5, the error came up but the identity showed no errors.

- Go under build settings and select packaging.
- Delete the current paths for Debug and Release and enter your new path where the info.plist is kept.

For example [APPROJECTNAME]/[THEINFOPLISTFOLDER]/info.plist
In the screenshot below, the path is API-client/Resources/info.plist

[![enter image description here][1]][1]


**SWIFT 4**

To fix it, go to the general tab and under identity reselect the info.plist that you like

[![enter image description here][2]][2]


[![enter image description here][3]][3]


[1]:

[2]:

[3]:
Reply

#3
I got this error when I put the Info.plist file inside a folder. Then when I extracted the file to public view, the error went away.
Reply

#4
My issue was a missing SettingsController file.

I copied a file from projectA to projectB but forgot to tick `Copy items if needed`. Unbeknownst to me a couple of weeks later when I deleted projectA the SettingsController file in projectB got deleted along with it. Afterwards in projectB the error `Build input file cannot be found ... path/Folder/toSomeFile` was shown.

To fix it I closed Xcode, went to the main folder that it was in, opened the folder and right clicked on the **blue** Xcode icon with the extension `.xcodeproj`, then I choose `Show Package Contents`

[![enter image description here][1]][1]

From there I double clicked on the `project.pbxproj` icon

[![enter image description here][2]][2]

Once the `project.pbxproj` file was opened I pressed **command+f** and in the search field I entered the path part of the error `path/Folder/toSomeFile`

It took me to 1-2 lines of code that looked like this

[![enter image description here][3]][3]

Once I deleted those 1-2 lines, when I went back to the projectB and opened it the error was gone.

Just for a little more clarity the exact path of the error was `whogotgame_42/whogotgame/Controllers/SettingsController.swift`. So that is what I exactly entered in the `project.pbxproj` search field to get to those 1-2 lines that you see in the picture.


[1]:

[2]:

[3]:
Reply

#5
# Update for Projects w/ Swift Packages

## How did the errors happen?

I ran into this issue when I had imported Swift Packages into my project but later cleaned `DerivedData` to fix an unrelated app caching issue. My existing project was not a local Swift Package but an iOS app project.

Note that we can still encounter the same issue in local Swift Package projects.

## What is the reason for the errors?

Swift Packages are checked out into `DerivedData` and are not referenced from the `ModuleCache.noindex` subfolder. Thus, cleaning the app's folder in `DerivedData` or `DerivedData` itself breaks dependency resolution within Xcode for Swift Packages.

This is a misleading build error since there may be nothing wrong with the app code you've written or your dependency resolution graph. The only thing required is to refresh the dependencies.

## How can I resolve the build errors?

Xcode now has nice options within the IDE itself to resolve Swift Packages. These options trigger a new checkout into `DerivedData`:

[![enter image description here][1]][1]

We can use three options, as shown in the image above depending on our use case:
1. <kbd>Reset Package Caches</kbd>: Trigger a re-install of your existing Package dependencies w/ same versions.
2. <kbd>Resolve Package Versions</kbd>: Use this option for updating Package checkouts when fixing Package Versions for cross-compatibility (in Project Settings).
3. <kbd>Update to Latest Package Versions</kbd>: Use this to update all Swift Package dependencies to the latest versions. This option may be a local breaking change if the API changes.

**NOTE**: Apple's documentation [recommends][2] to use Xcode for dependency resolution when working with Xcode projects excluding CLTs.

## Other solutions

1. We can also fix the error by restarting Xcode, but I find this step breaks my workflow and is tedious.
2. If we are running from the command line (local Swift Package executable), we can stick with a `swift build` variant without jumping to Xcode at all ([Source][3]). `swift build` doesn't work as easily out of the box in other projects, however.
3. Use `xcodebuild`:

xcodebuild -resolvePackageDependencies

I prefer staying in Xcode for simplicity but YMMV.


[1]:

[2]:

[To see links please register here]

[3]:

[To see links please register here]

Reply

#6
You can use $(INFOSTRINGS_PATH)

It's Bundle file path. Specifies the file that contains the bundle’s localized strings file.

Reply

#7
I got this issue after resolving the conflicts in project.pbxproj.

Step 1: Removing the "Build input files cannot be found" files from BuildPhases -> Copy Bundle resources and adding them back worked for me.

If the above Step 1 doesn't work, search for "Recovered References" folder in your project structure and remove the files that are causing this issue and repeat Step 1
Reply

#8
In my case, it was due to localization.
Here's how to fix it.
[

[To see links please register here]

][1]


[1]:

[To see links please register here]

Reply

#9
If all else fails:

1. In Xcode. Remove references of files in question from your project.
2. Open your project.pbxproj file as a file in Xcode. This is in <Your project>.xcodeproj
3. Delete all lines containing the name of said files. Save.
4. Back in Xcode. Re-add files to your project in Xcode.
Reply

#10
**Adjust the file path according to that provided in the Xcode Error**
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through