I Deleted A File, And Xcode Is Giving A Clang Error - ios

I imported a file (tlb.c), but then I (intentionally) deleted it. Now when I run the project, Xcode is giving a clang error and says that it is because it cannot find "tlb.c". I did not edit any of the original files to reference it, so I don't see any reason why it would throw this error.
I deleted it because I realized that I did not download the .h file that went with it.
I have cleaned the project, and completely restarted Xcode multiple times.
Here is the error it gives me:
clang: error: no such file or directory: '/Users/Tom/Desktop/Test64iOS Resource/Test64iOS/tlb.c'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

Did you remove the file from your project as well as delete it from disk? If you failed to remove if from your project you'll still see it project navigator except the font will be red.
If that's not your problem, select your project root in Project Navigator and then select "build phases." There's a "Compile Sources" section. See if the file is listed there and remove it.

Just ran into this same issue on Xcode 9.1,
I checked out the "Compile Sources" section but the file wasn't listed. I cleaned the project multiple times, tried searching my computer for the file to restore it (it wasn't anywhere to be found).
Finally, I just exited Xcode and came back. Error gone.

Related

Error: Build Input file not found, when tried to run the app on iOS simulator

After upgrading the Xcode to 12.2 from 11.x , I'm getting a wierd error when trying to run the app on iOS Simulator.
The error is:
error: Build input file cannot be found: '/Users/mrt/Library/Developer/Xcode/DerivedData/xxx-fqqnstjlfcnipqbcjbnhysubdksn/Build/Products/Debug-iphonesimulator/xxx.app/xxx' (in target 'xxx' from project 'xxx')
Here the missing /xxx is the unix executable file inside the .app folder.
When I try to build it on phone, there is no such error.
When I checked the location in finder, the unix executable file inside the .app is missing, for Debug-iphonesimulator, but it is present in Debug-iphoneos
I have no idea, why that executable file is missing.
I have added the arm64 in the excluded arch section in the new Xcode. Both in project and target Buil Settings.
I tried changing project settings to Legacy Build, and it resulted in same error.
I haven't moved any plist files or any files in my project. I deleted some unused targets and related files. The error didnot mention anything about deleted files. Hence I do not think , those could be the reason. I tried this SO link, and it didnt solve my issue. My plist file path is $(SRCROOT)/xxx/SupportingFiles/xxx.plist
I did delete derived data and clean, many times. Not solved.
I tried adding x86_64 under VALID_ARCHS and adding arm64 under exluded arch settings, as suggested in here. Not solved.
Is there anything that I'm missing ?
THIS error maybe your update Xcode version like: Xcode 10 to Xcode 12, the your old PROJECTS will got this error, can't running your app again.
Try this:
1:
VALID_ARCHS (in the "Architectures" tab) key on the BuildSettings of "PROJECT" GROUP
or just search "VALID_ARCHS", maybe in the other Tabs( or in the "User-Defined")
set value "arm64" or others
IMG SIMPLE:
2:
select TARGETS: your app's target
search for the same KEY ("VALID_ARCHS") and just selection the current row and click "delete" on your keyboard, there will be with default values(it is the same value of PROJECT's Build Settings )
3: clear and rebuild

Command [...]/clang failed with exit code 1

I have a serious problem with one of my ios application because i can't compile it anymore. I think its due to a mislinked file (see the error at the end).
The whole story started when i wasn't able to add a file to a target. I then couldn't build because of this error, see: Duplicate interface declaration for class 'Foo'. Xcode miracously copied my sources within itself to a subfolder with the projectname. I deleted as suggested but i know keep running into the error pasted at the bottom.
In effect it is due to clang looking for a file a very deeeeeeeply in itself nested folder which of course doesn't exists. What did xcode do here and how can i get it working again?
This is the last part of the error
clang: error: no such file or directory: '/Users/Shared/projects/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/samefolder/AppDelegate.m'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Okay i found it! I knew there had to be a list of files it tries to compile somewhere. I finally found it under the targets build phases. There you have entries for "compile sources" and "copy bundle resources" which both got cluttered in my case. I corrected those file lists and it finally worked again.

xcode llvm 5.0 error no such file or directory

I have this error displaying, the LLVM APPlE 5.0 ANY IDEAS?
i have also cleaned, deleted the derived data, checked the scroll view delegate methods, checked the prefix in build settings and the build phases
clang: error: no such file or directory: '/Users/zoe/Documents/PROJECT /TapADogNEW copy 2/TapADogNEW/TapADogNEW/TapADogNEW-Prefix.pch'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
The reason is described in error message: It can't find *.pch file:
Check target settings and set correct path to prefix header file:
I get this error in Xcode 6 anytime I rename a file.
Normally in Xcode 5 I would rename a project, but that doesn't work in Xcode 6.
I have to go back to the original name, because it doesn't change the name in all the correct locations.
Submitted a bug report: 19086479
I just created the pch file from File->NewFile->Other->pch file and replaced the oldone. After that project was build successfully

Apple LLVM Compiler 4.2 Error : NO such file or directory

I get a error from the Xcode as below:
clang: error: no such file or directory: '/Users/Ashok/Desktop/projectdir/AScommon/View Support/GradientView.m'
clang: error: no input files
Command
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
The main thing is that file/directory path shown above doesnot exists in my mac.
Have tried with the following:
I even set the paths in the Build setting search paths.
I have tried all the methods of cleaning the project,
reopening of the xcode, clearing the derived data.
Can anybody please guide me the solutions, so the app will built without errors.
Thanks in advance.
Sometimes it happens like this.May GradientView.m exists in your target location, just check whether it is available in your project and its color should not be red. If it is red then select that file and delete that file.And again add it by Right click on your project > Add files to "Your project" > add again GradientView.m file. Then Product > clean and built > run.
The problem might be because your project > target > Build Phases > Compile Sources is trying to compile a file that doesn't exist. Please check if GradientView.m exists according to above step.

clang: error: linker command failed with exit code 1, only when testing on device

I was just about to test my app on a device when I ran into this problem, I'm getting this Linker Error.
I've already checked all my compile sources and Build Phases, but there's no sign of my importing things twice.
ld: duplicate symbol _calculateNextSearchPage in /Users/wouter/Sites/test/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit) and /Users/wouter/Sites/test/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit) for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This only happens when testing on a device, not in the simulator.
Alright guys I had the same problem. Seems like I fixed it.
I am using cocapods therefor the described standard procedure can not be properly executed.
Steps to do to properly add FastPDFKit with Cocoapods.
Download FastPDFKit
In your project Add Files to "Your Project"
go to FastPDFKit folder you just have downloaded
locate 1 folder and 1 project file. Press and hold Command key and add these in to your project
FastPdfKit.xcodeproj
FastPdfKit.embeddedframework
(Note: FastPdfKit.embeddedframework is the actual Framework and you
might want to open FastPdfKit.xcodeproj standalone before adding it
to your project, delete FastPdfKit.embeddedframework folder from
your disk and Build FastPdfKit target in the project. You should see
newly created FastPdfKit.embeddedframework folder)
Go to your Project Settings > Your target > Build Phases > Link Binary with Libraries
Make sure FastPdfKit.framework is there.
If not, drag it from the project and put it there.
Clean the project, delete derived data
Add #import <FastPdfKit/FastPdfKit.h> where you need it and you are good to go.
Here is how my Link Binary with Libraries look like
Please let me know if you have any troubles I might've missed something.
Try to delete duplicate files/images which are in target-> Build phase -> Compile files, Copy bundle resources

Resources