clang: error: no such file or directory - xcode

Added JSONKit to an Xcode project and am getting this error:
clang: error: no such file or directory: '/Users/snowcrash/Downloads/ILGeoNames-develop/SampleApp/../JSONKit/JSONKit.m'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
However, the JSONKit files do appear to be there. E.g.
How do I figure out the problem (and fix it!)?

You need to check Compile resources in the Target Project
You will Find that
JSONKit
is in red color
just delete it and go

you have to check 'copy files' when adding the group else they are left where they are and the path breaks when you move the project

I tried re-adding files, but have no work.
So, I find the .pbxproj file in .xcodeproj, delete rows include the file name, then rebuild, success!

Related

How to fix a library not found error on Xcode

I use Xcode 11.3.1.
I receive an Xcode project from a coworker that is using Xcode 12.4.
I open the project and try to build it.
I receive the following error:
Library not found for ISO8601DateFormatterValueTransformer
Inside Xcode there are some details:
ld: warning: directory not found for option '-L/Users/catalina/Library/Developer/Xcode/DerivedData/CDA-chskvgcrkhxpgnghuarozjoeymbq/Build/Products/Debug-iphonesimulator/ISO8601DateFormatterValueTransformer'
ld: warning: directory not found for option '-L/Users/catalina/Library/Developer/Xcode/DerivedData/CDA-chskvgcrkhxpgnghuarozjoeymbq/Build/Products/Debug-iphonesimulator/RKValueTransformers'
ld: warning: directory not found for option '-L/Users/catalina/Library/Developer/Xcode/DerivedData/CDA-chskvgcrkhxpgnghuarozjoeymbq/Build/Products/Debug-iphonesimulator/RestKit'
ld: warning: directory not found for option '-L/Users/catalina/Library/Developer/Xcode/DerivedData/CDA-chskvgcrkhxpgnghuarozjoeymbq/Build/Products/Debug-iphonesimulator/SOCKit'
ld: warning: directory not found for option '-L/Users/catalina/Library/Developer/Xcode/DerivedData/CDA-chskvgcrkhxpgnghuarozjoeymbq/Build/Products/Debug-iphonesimulator/TransitionKit'
ld: warning: directory not found for option '-L/Users/catalina/Library/Developer/Xcode/DerivedData/CDA-chskvgcrkhxpgnghuarozjoeymbq/Build/Products/Debug-iphonesimulator/ZBarSDK'
ld: library not found for -lISO8601DateFormatterValueTransformer
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My coworker said to me to delete the Pods folder and run the pod install command. After running the command some libraries are installed on the project.
But when I try to build the project, it fails.
This problem could be related to my Xcode version? I mean, I was trying to compile a project using an old version of Xcode
Or
this is a problem related to not importing correctly the Library?
I find out what was causing the problem.
I open the xcproject file. The correct file to open the project is the xcworkspace file.
The problem is fixed now.

No such file or directory when archiving

I added Firebase to my Xcode project using cocoapods. I can build and it succeeds, I only get this warning:
ld: warning: directory not found for option '-F/Users/.../Library/Developer/Xcode/DerivedData/game-dwgqybwtgjx..../Build/Intermediates/ArchiveIntermediates/game/BuildProductsPath/Release-iphoneos/GoogleToolboxForMac'
ld: warning: directory not found for option '-F/Users/.../Library/Developer/Xcode/DerivedData/game-dwgqybwtgj..../Build/Intermediates/ArchiveIntermediates/game/BuildProductsPath/Release-iphoneos/Protobuf'
The build succeeds but the archive doesn't.
When I click archive I get these warnings and errors:
/Users/..../Library/Developer/Xcode/DerivedData/game-dwgqybwtg.../Build/Intermediates/ArchiveIntermediates/game/InstallationBuildProductsLocation/Applications/game.app/Frameworks/GoogleToolboxForMac.framework: No such file or directory
Managed to fix the problem by updating macOS and Xcode

Unexplained Apple Mach-O liner warning error

Yesterday i integrated Google's Admobs fine into my Xcode 6.1 project. Everything worked. Today i open Xcode and i receive the following errors...
ld: warning: directory not found for option '-L/Users/Marco/Desktop/SpaceAlien copy 1/Space
ld: warning: directory not found for option '-LAlien'
ld: library not found for -lGoogleAdMobAds
It's 2 yellow warning errors and the RED error doesn't let me build project = GoogleAdMobAds
So I read in Project Navigator for libGoogleAdMobAds.a in target membership to unclick and then click back the check. That works and project builds. However, when i close project open it again, I get the same error. How do I make this error remove permanently? Also, for the ld: warning: directory not found errors I went to build setting then library search paths and i CAN'T delete anything, don't know what to do. Please HELP!
ld: warning: directory not found for option '-L/Users/Marco/Desktop/SpaceAlien copy 1/Space
Problem is because the path contains spaces. Try using quotes with the path: "Users/Marco/Desktop/SpaceAlien copy 1/Space"
or you can use escape "\" character to "fix" the path:
Users/Marco/Desktop/SpaceAlien\ copy\ 1/Space

ERROR: Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

I am developing an app for iPhone and iPad.
Suddenly I can't run my project because of this error:
clang: error: no such file or directory: '/Users/AkdemiaMacBookAir/Developer/iOS/ios-akdemia/ios-akdemia/ios-akdemia-Prefix.pch'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
I was looking for in Stack Overflow and I actually checked out that my Prefix Header is correct.
And here is the file:
I don't understand why xcode try to compile the pch from this path '/Users/AkdemiaMacBookAir/Developer/iOS/ios-akdemia/ios-akdemia/ios-akdemia-Prefix.pch' if I never told it that.
This guy fixed it:
http://www.buzztouch.com/forum/thread.php?tid=F42D8239A330C321132944A&currentPage=3
This was his answer:
Click on the name of your project on the list of files/folders on the left in Xcode (at the very top of the list). Look at the "Targets" section on the left-hand side of the window to the right. Likely, there's two listed with the second being a "test" item. Right-click on that item and select "delete". Then try to run the project again. See screenshot below for a visual cue.

Duplicate Symbole in xCode, But no duplicate exist

The Problem
Xcode (Version 4.6.1 (4H512)) is complaining a duplicate symbole problem.
duplicate symbol _OBJC_METACLASS_$_PacksStoreHelper in:
/Users/shannoga/Library/Developer/Xcode/DerivedData/English_Club-cyrjamihpabtvtdkvctjwyidupuo/Build/Intermediates/English Club.build/Debug-iphonesimulator/English Club.build/Objects-normal/i386/PacksStoreViewController.o
/Users/shannoga/Library/Developer/Xcode/DerivedData/English_Club-cyrjamihpabtvtdkvctjwyidupuo/Build/Intermediates/English Club.build/Debug-iphonesimulator/English Club.build/Objects-normal/i386/PacksStoreHelper.o
duplicate symbol _OBJC_CLASS_$_PacksStoreHelper in:
/Users/shannoga/Library/Developer/Xcode/DerivedData/English_Club-cyrjamihpabtvtdkvctjwyidupuo/Build/Intermediates/English Club.build/Debug-iphonesimulator/English Club.build/Objects-normal/i386/PacksStoreViewController.o
/Users/shannoga/Library/Developer/Xcode/DerivedData/English_Club-cyrjamihpabtvtdkvctjwyidupuo/Build/Intermediates/English Club.build/Debug-iphonesimulator/English Club.build/Objects-normal/i386/PacksStoreHelper.o
ld: 2 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Usually I go to the Target Build Pases -> Compile Sources and look for the duplicate.
This time as you can see there is no duplication there:
What I tried and some wacky stuff :
Deleting Derived Data.
Removing the project and restarted the mac.
I even tried to delete the so called "duplicate" files and here it got even more wacky - The target successfully builded and there was no warning even that the files were not visible in the file navigator. After the build the app works fine but one of the controllers is not visible.
I Alt+Clicked the import statements of the duplicate files in other files that uses them and it gets me onto a "Zombie" file with all the code inside. But I can not see where xCode get the file from.
What the hell could it be?
I am about to shoot myself. Please save me.

Resources