There must be something wrong with the way I build my project.
I noticed that when I move my Xcode project folder from a directory inside my document folder to the desktop for example, it doesn't build when it previously does! In my case this time, somehow it can't find the Core Plot sub project.
It says:
clang: error: no such file or directory: '/Users/t2wu/Library/Developer/Xcode/DerivedData/HRM-fxvjidgvnxghjogeevqdzlccbulu/Build/Products/Debug-iphonesimulator/libCorePlot-CocoaTouch.a'
Any pointer appreciated.
For your current error clean should help
Use macro $(SOURCE_ROOT) for any third party library.
Related
i have one small project, which is hosted on bitbucket.
I just switch computer and my project is broken.
as you can see below :
clang: error: no such file or directory: '/Users/dev/iOS-dev/chanakya/Chanakya/../../../../../Al/Developer/BitBuck/Chanakya/Chanakya/leafContents.m'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
All the necessary files are there but seems like project somehow stored the absolute path of files rather than relative. As I just started working on new system, I m sure all the project will be broken.
Can anyone suggest me how can I fix current problem and how can I avoid this kind of problem in future.
Any help is very much appreciated.
Wow... tail between legs...
So I clicked "add files to project" in Xcode. My entire project folder came up selected by default, as it usually does. I changed my mind and went to click "cancel", but accidentally clicked "add"... so it basically created this loop of continually adding my project folder inside my project folder... inside my project folder etc.. until it finally errored & stopped. (brought my project folder from about 25Mb to almost 3 gigs!!!
I went into my actual project folder (in finder, not in xcode) and deleted the duplicate folder that contained all the other duplicates. But now when I try to build, I get all kinds of errors. This may be the most embarrassing thing I've ever done. I have a repo backup from 5 days ago, but I'd rather not lose 5 days worth of work. Can someone please help me :( 1 billion internet points to whoever can help me so i can keep working tonight!
here are the errors:
Lipo Error:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo:
can't open input file:
/Users/Daniel/Library/Developer/Xcode/DerivedData/appname-rtgmnzqeqhksvjbmtqtvnaudfgr/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/appname
(No such file or directory)
Apple Mach-O Linker Error: ld: 5 duplicate symbols for architecture
armv7 clang: error: linker command failed with exit code 1 (use -v to
see invocation)
Dsymutil Error: GenerateDSYMFile
/Users/Daniel/Library/Developer/Xcode/DerivedData/appname-gahmnzqeqhksvjbmtqtvnauibzrx/Build/Products/Debug-iphoneos/appname.app.dSYM
/Users/Daniel/Library/Developer/Xcode/DerivedData/appname-gahmnzqeqhksvjbmtqtvnauibzrx/Build/Products/Debug-iphoneos/appname.app/appname
cd /Users/Daniel/appDirectory
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil
/Users/Daniel/Library/Developer/Xcode/DerivedData/appname-gahmnzqeqhksvjbmtqtvnauibzrx/Build/Products/Debug-iphoneos/appname.app/appname
-o /Users/Daniel/Library/Developer/Xcode/DerivedData/appname-gahmnzqeqhksvjbmtqtvnauibzrx/Build/Products/Debug-iphoneos/appname.app.dSYM
error: unable to open executable
'/Users/Daniel/Library/Developer/Xcode/DerivedData/appname-gahmnzqeqhksvjbmtqtvnauibzrx/Build/Products/Debug-iphoneos/appname.app/appname'
I Don't know whether i will be able to make you understand or not but i have tried this weired thing just for you and I have got the same error.
Then i found solution for myself, may be it will also help you.
Go to Build Phase -> compile source and then select all the files you see with postioning folder inside a folder like I have shown in screen shot below. you can see the main.m file inside slider/slider/slider..... where slider is my main project folder.
just check for it and press the minus button on the bottom . this will delete all the duplicate files from the finder. same for the images can be done like i have shown in the screen shot.
Then go to your project's finder and just delete the first folder which contain all the folders and project will run smoothly.
I have done this hope this will help you also. (please have a backup of your project before doing it ) :)
I'm getting the following error:
ld: library not found for -lGoogleAnalytics
clang: error: linker command failed with exit code 1 (use -v to see invokation)
I've spent some time googling but can't find how to fix this problem. I'm new to xcode and this is an existing project that I need to work on.
In my case, the project uses CocoaPods. And some files are missing from my project.
So I install it from CocoaPods: https://cocoapods.org/.
And if the project uses CocoaPods we've to be aware to always open the .xcworkspace folder instead of the .xcodeproj folder in the Xcode.
You need to set the "linker search paths" of the project (for both Debug and Release builds). If this library was in, say, a sibling directory to the project then you can set it like this:
$(PROJECT_DIR)/../GoogleAnalytics/lib
(you want to avoid using an absolute path, instead keep the library directory relative to the project).
All in all, the Xcode cannot find the position of library/header/framework, then you tell Xcode where they are.
set the path that Xcode use to find library/header/framework in Build Settings --> Library/Header/Framework Search Paths.
Say, now it cannot find -lGoogleAnalytics, so you add the directory where -lGoogleAnalytics is to the Library Search Paths.
In my case I had a project with lots of entries in "Build Settings > Other Linker Flags"
I needed to reduce it down to just
$(inherited)
-ObjC
Old settings:
Updated settings:
For me, I open the projectname.xcworkspace file and it all works.
If you have pods installed, make sure to open the workspace folder (white Xcode icon) not the project folder. This resolved the library not found for ... error. Very simple issue but I was stuck on this for a long time.
This worked for me:
Go to build setting -> Linking -> Other Linker Flags -> Remove all other than $(inherited)
Cd ios && pod update
If you are using Pods to include the GoogleAnalytics iOS SDK into your project, it's worth noting that since the 3.0 release your Other Linker Flags needs to include -lGoogleAnalyticsServices not the old -lGoogleAnalytics
If your library file is called libGoogleAnalytics.a you need to put -lGoogleAnalytics so make sure the .a file is named as you'd expect
None of the above worked for me, what did was making sure the Pod file platform :ios, '11.0' matched with the minimum deployment target in the XCODE setting
You can also try to lint with the --use-library option, as cocoapods lint libraries as framework by default since v0.36
The problem might be the following: SVN ignores .a files because of its global config, which means someone didn't commit the libGoogleAnalytics.a to SVN, because it didn't show up in SVN. So now you try to check out the project from SVN which now misses the libGoogleAnalytics.a (since it was ignored and was not committed). Of course the build fails.
You might want to change the global ignore config from SVN to stop ignoring *.a files.
Or just add the one missing libGoogleAnalytics.a file manually to your SVN working copy instead of changing SVNs global ignore config.
Then re-add libGoogleAnalytics.a to your XCode project and commit it to SVN.
In XCode 10.1, I had to set "Library Search Paths" to something like $(PROJECT_DIR)/.../path/to/your/library
For me it was a silly thing: my mac uploaded the file into iCloud, and that is why Xcode did not find it.
If you turn off the automatic upload, it wont happen again.
I had a file which I deleted and replaced with another file, somewhere else, of the same name.
Despite cleaning, and trying this multiple times, I keep getting this error:
clang: error: no such file or directory: '/Users/Andrew/App/Version 1.1/XCode/UIImage+Alpha.m'
clang: error: no input files
I can't continue working on my app because of it. Any ideas?
The problem might be because your project > target > Build Phases > Compile Sources is trying to compile a file that doesn't exist. It might be in there twice, like the below screen shot. My project contains UIImage+FFXtras, I can even remove it and re-add it and this won't resolve the problem!
I'm not sure how the project gets into this state - but I know it's not obvious what is going wrong. Highlight the red problem one and remove it.
So have a look in compile sources phase for the file clang is complaining about.
Got the similar troubles.
It seems XCode does not generate correct relative filepath when your project refer to an already existing source tree (relative path does not contain the .xcodeproj in the path of the file to be compiled).
There is a simple fix however: in the project explorer select the file or files files then look at the options in the file inspector. One of them is labeled "Location"; set it to absolut path and try again. This fixed the issue for me :)
Additional to all answers:
delete derived data
reboot
delete derived data
clean
build
Success!
Only this sequence works for me in my case.
I use quite a few cocoa pods and have just had this happen to me. A quick "pods update" sorted things out for me. -phil
If you are using vs code and facing this issue which says
clang: error: no such file or directory: 'filename'
clang: error: no input files
Error while running files:
I solved this issue by removing the space or replacing the space with underscore(_) in the filename .extension
In case everything fails (i.e. first try bames53 suggestion)
Ok, this might be dangerous so make a copy of your whole project first:
close Xcode
locate the project file in the Finder
right click, choose "show package contents"
open project.pbxproj in a text editor of your choice, but not Xcode
search for your file
at the beginning of the line that shows up, you'll see some id like 640450991409CF5C00B3B580. Search for this and delete any line you find.
pay attention, not to break the syntax (balance parenthesis and brackets, pay attention for commas)
when you are done, save the file and try to open the project in Xcode. Add the missing file via the Add file… dialog of Xcode. It is still in the folder of your project — if you added it successfully in the first place — you just got rid of all project references.
dont be surprised, if it doesnt work instantly — you have a copy. copy it again, new try.
And remember: make a copy of your whole project first — for every try. or copying the project.pbxproj might be enough.
Add this line in your pod-file and run pod install:
use_frameworks!
I had this error in monodevelop. I just went to edit>preferences
and changed the default location of the program files. It was set to the monodevelop default they give you when you open a file and not the folder i changed it too.
Likely, you need to adjust the settings of xcode, where you stored your files.
I was seeing this while setting up a React Native project. Solved it using:
sudo xcode-select --switch /Applications/Xcode.app
Source
Comment Quoted from another site was the issue is resolved for me
hmm that's strange. Try this - 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.
I am looking at an Xcode project that uses some libraries. The project was created on a different computer, so I need to update some paths. The library search paths all start with $(SRCROOT). What does that mean?
It's the path to the directory containing the Xcode project.
That's basically your project root directory defined by Xcode.
http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW38
SRCROOT
$(SRCROOT)(aka $(SOURCE_ROOT)) is a path to your location where a.xcodeproj is.
It is simple to check, just put it in a field and Xcode gives you a tip