Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Error : No such file or directory when building

Tags:

xcode

ios

build

I've read similar threads but wasn't able to find a solution to my issue.

When I start my project, I first saved it in a folder with blank space in its name (let name it "My Project")
Lets also simplify the path through my project as a simple folder : "My path" (yes, there was blank spaces in the hierarchy).

I used to have issues while building my project, especially with the Library search path in Build settings, regularly coming back with xcode updates or/and duplication of project for keeping a historical.

To solved that, I've replaced all the blank spaces with underscores. So now my project's folder name is "My_Project" and the path "My_path". These changes have also been performed in the Build Settings of my project.

But today, I have an error I can't get rid of.
When I build my project, every file compile perfectly, but during the "copying" process, I get this kind of error.

/!\Copy AFNetworking ...in /Users/admin/Desktop/My_path/My Project/Product-name/Sub Folder

CpResource /Users/admin/Desktop/My_path/My\ Project/Product-name/Sub\ Folder/AFNetworking /Users/admin/Library/Developer/Xcode/DerivedData/Product-name-gkplyeugxcxhijajdvpxutaodxmz/Build/Products/Release-iphoneos/Product-name.app/AFNetworking
cd /Users/admin/Desktop/My_path/My_Project/Product-name
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -strip-debug-symbols -strip-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -resolve-src-symlinks /Users/admin/Desktop/My_path/My\ Project/Product-name/Sub\ Folder/AFNetworking /Users/admin/Library/Developer/Xcode/DerivedData/Product-name-gkplyeugxcxhijajdvpxutaodxmz/Build/Products/Release-iphoneos/Product-name.app
-------------------------------------
error: /Users/admin/Desktop/My_path/My Project/Product-name/Sub Folder/AFNetworking: No such file or directory

I don't find in my target's Build Settings any field where blank spaces haven't been replaced by underscores.

Any help appreciated.

(I'm using Xcode 7.2, OS X El Capitan 10.11.2)

like image 368
zbMax Avatar asked Jan 21 '16 10:01

zbMax


2 Answers

I finally find somewhat by chance an answer to my problem.

I've opened the .xcodeproj file in finder, and then edit project.pbxproj. In this file, I've founded a line :

84635D6F1C22F90100C55AB2 /* AFNetworking */ = {isa = PBXFileReference; lastKnownFileType = folder; name = AFNetworking; path = "/Users/admin/Desktop/My_path/My Project/Product-name/Sub Folder/AFNetworking"; sourceTree = "<absolute>"; };

And retyping it properly made the trick.

like image 85
zbMax Avatar answered Nov 14 '22 23:11

zbMax


This medium post helped me: https://freakycoder.com/ios-notes-47-how-to-solve-xcode-no-such-file-or-directory-error-514106eaf287

Needed to remove the resource under Copy Bundle Resource during the Build Phase

enter image description here

like image 27
RamRovi Avatar answered Nov 14 '22 22:11

RamRovi