Xcode doesn't recognise files created by projucer

projucer

#1

Please excuse my newbidity if this is totally stupid…

Not always, but quite often, when I use the projucer to create new class/file/doesn’t matter
the new files appears in red after exporting to xcode and cannot be located by it.
it can happen several times and then suddenly, on the 7th try, turned out right.

Couldn’t find anything on the forums, this is going on since I’ve moved to juce 5.
Thanx for your time, anyone.
Ben


#2

I can’t reproduce this. Are you definitely adding new files via the Projucer with the plus button in the file explorer (1) and saving and opening the project in Xcode (2)?


#3

Thanx for your reply, ed95.
Yes, I am definitely doing those.
But you did help me solve this, I think.
I was screen shooting the xcode window, with the new files painted red,(left arrow) and then I suddenly noticed that all my JUCE projects are located in a folder that has spaces in its name.
(something that a real programmer would never do… Right arrow).
I’ve changed that and it hasn’t reproduced since.
It use to happen 9 out of 10 tries.
Well, it was never a problem with JUCE 4.
I hope that that was it, I will share if its coming back.
Thanx again.
Ben


#4

I have encountered similar symptoms but with a different cause: if the path to the jucer file contains a symbolic link, Projucer emits corrupt file paths into the Xcode project.

For example, suppose your working directory is /very/long/path/for/jucer.
This path is annoying so you create a symbolic link to shorten it:
> sudo ln -s /very/long/path/for/jucer /abslink
(Our sandbox paths get very long so we do this a lot.)
If you create and use the project using /very/long/path/for/jucer then it works ok.
If you create the project using /abslink then it fails: when you add a new file, save and open in Xcode, the new file is red because the file path is corrupted.

In the screen shot below, the path to SourceCode.cpp is /very/long/path/for/very/long/path/for/jucer/RelLinkProject/Source/SourceCode.cpp

Interestingly, if you close the “bad” project (created using /abslink) and reopen it via /very/long/path/for/jucer, save and open in Xcode, it works.

And if you close the “good” project (created using /very/long/path/for/jucer) and reopen it via /abslink, save and open in Xcode, it works.

Perhaps the problem is associated with how the file gets added - the file in the “good” project appears to have a relative path, and the file in the “bad” project has an absolute path.

I hope this is enough information for someone to debug this.


#5

Hmmm just trying to reproduce this.

Are you using the Projucer from the console?
Does your “working directory” contain the full JUCE project i.e. also the .jucer file or does it only contain the source files?


#6

Hi Fabian,
Thanks for investigating. Sorry to not be more clear.

I’m using terminal to create the directories and symbolic links, but otherwise I’m using the Projucer in normal GUI mode. Here are some screenshots of what I did.


I start from an empty folder. Notice the path at the top reflects the full absolute path; the path at the bottom reflects the symbolic link.

00%20empty%20folder


Create a new console project. Notice the folder is using the symbolic link path.

01%20create%20console%20project


Here’s the new project in the Projucer:

02%20new%20project%20in%20projucer


And here’s the new project in the finder. Curiously, the path at the bottom switched to the full absolute path.

03%20new%20project%20in%20finder


Next add a new cpp file:

04%20add%20new%20cpp%20file


Here’s the new cpp file in the finder:
05%20new%20cpp%20file%20in%20finder


Here’s the new cpp file in the Projucer. We are about to save the project and open it in Xcode
06%20new%20cpp%20file%20in%20projucer


Here is the new project in Xcode (after navigating to SourceCode.cpp). The file is red because the prefix of the full path is “/very/long/path/for/very/long/path/for”.


#7

I’m not having much luck reproducing things lately:


#8

I had the same kind of problem (forbidden characters in file names, this time with Xcode unable to parse the projucer generated file. The file I had added contained a ‘é’ in it. Corrected when removed the accented char.