6

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)

zbMax
  • 2,756
  • 3
  • 21
  • 42
  • You can have spaces in the project name, or anywhere in the path, and Xcode will cope with it. If you write your own build scripts, however, you will need to take that precaution yourself. Anyway does that file actually exist? (Start *Terminal.app* and type `file '/Users/admin/Desktop/My_path/My Project/Product-name/Sub Folder/AFNetworking'` and post the response in your question). – trojanfoe Jan 21 '16 at 10:58
  • Under build phases - > compiled sources , check either source file is added or not. – AskIOS Jan 21 '16 at 11:02
  • Yes, my folder AFNetworking exists in `/Users/admin/Desktop/My_path/My_project/Product-name/Sub_Folder/AFNetworking` and every files included in this folder are rightly referenced in the compile sources – zbMax Jan 21 '16 at 11:06
  • `My_project`? That's not what the error message in your question says... – trojanfoe Jan 21 '16 at 11:30
  • Sorry, it should be written as `My_Project` (missing capital when replacing "real" path) – zbMax Jan 22 '16 at 07:53
  • It's the underscore that concerns me as it shows the error message you posted does not reflect reality. The devil is in the detail and if you don't present everything accurately you have little chance of a solution. – trojanfoe Jan 22 '16 at 08:05
  • Any way to carry on privately ? I don't want some of these info to be public. – zbMax Jan 22 '16 at 08:48
  • for me [this answer](http://stackoverflow.com/a/11631659/1641457) was the standard solution to overcome such an error! – Navid Apr 26 '16 at 06:03

2 Answers2

8

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.

Community
  • 1
  • 1
zbMax
  • 2,756
  • 3
  • 21
  • 42
4

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

RamRovi
  • 986
  • 9
  • 13