A build error in Xcode

When I build my Unity project, when it comes up in Xcode and tries to build, it comes up with this error

cp: /Applications/…/Data: No such file or directory

Anyone know how to fix this?

Hmm, haven’t been able to find anyone else that is having this problem, can’t even figure out where the source of the problem is.

Just to check that

  • You are using XCode 3.1.2
  • You are using OSX 10.5.4+
  • You tried reinstalling Unity to ensure its not some sideeffect of something

And makes sure that the iPhone SDK is installed.

Can you build any of the sample apps that come with the SDK? Can you build Unity Remote? Can you get those running on iPhone hardware? That would help narrow down the problem.

I have Xcode 3.1.2, with developers licens, I can run the remote fine as well.
I have OSX 10.5.5.
I am going to try to re-install Unity iPhone and see if that fixes anything.

Just re-DLed Unity, no change. Here is what it says during run time.

Unity runtime class registered 7251436
Unity runtime class registered 7296484
Unity runtime class registered 7394948
Unity runtime class registered 7409528
Unity runtime class registered 7425952
Unity runtime class registered 7427948
Unity runtime class registered 7434136
Unity runtime class registered 7483476
Unity runtime class registered 7483464
Unity runtime class registered 7483488
Unity runtime class registered 7483500
Unity runtime class registered 7539740
Unity runtime class registered 7483520
Unity runtime class registered 8160624
Unity runtime class registered 8228204
Unity runtime class registered 8357880
Unity runtime class registered 8385912
Unity runtime class registered 8760472
Unity runtime class registered 8903312
Unity runtime class registered 7573356
Unity runtime class registered 7580892
Unity runtime class registered 7527456
Unity runtime class registered 7566764
Unity runtime class registered 7594756
Unity runtime class registered 7652812
Unity runtime class registered 7684236
Unity runtime class registered 7897380
Unity runtime class registered 8021928
Unity runtime class registered 8180956
Unity runtime class registered 8653212
Unity runtime class registered 8723036
Unity runtime class registered 8491824
Unity runtime class registered 8497628
Unity runtime class registered 8890696
Unity runtime class registered 9052036
Unity runtime class registered 9060944
Unity runtime class registered 7684052
Unity runtime class registered 8870688
Unity runtime class registered 7543320
Unity runtime class registered 7656896
Unity runtime class registered 7686676
Unity runtime class registered 7686664
Unity runtime class registered 7711968
Unity runtime class registered 7888596
Unity runtime class registered 7888792
Unity runtime class registered 7888760
Unity runtime class registered 7686604
Unity runtime class registered 8025696
Unity runtime class registered 8060152
Unity runtime class registered 8067724
Unity runtime class registered 8157124
Unity runtime class registered 8195216
Unity runtime class registered 8610436
Unity runtime class registered 8616840
Unity runtime class registered 8641000
Unity runtime class registered 8673716
Unity runtime class registered 8674352
Unity runtime class registered 8043676
Unity runtime class registered 8678572
Unity runtime class registered 8663760
Unity runtime class registered 8813676
Unity runtime class registered 8872284
Unity runtime class registered 8887940
Unity runtime class registered 7481768
Unity runtime class registered 8914996
Unity runtime class registered 8934440
Unity runtime class registered 8936084
Unity runtime class registered 8952160
Unity runtime class registered 8952172
Unity runtime class registered 8970776
Unity runtime class registered 7672704
Unity runtime class registered 8186452
Unity runtime class registered 8450900
Unity runtime class registered 7531556
Unity runtime class registered 7672180
Unity runtime class registered 8524428
Unity runtime class registered 8525240
Unity runtime class registered 7672704
Unity runtime class registered 8186452
Unity runtime class registered 8433072
Unity runtime class registered 8439124
Unity runtime class registered 8450900
Unity runtime class registered 7845108
Unity runtime class registered 7846320
Unity runtime class registered 7870028
Unity runtime class registered 7877008
2009-01-05 14:26:34.879 GameCreator[173:20b] -> registered unity classes
2009-01-05 14:26:34.959 GameCreator[173:20b] -> registered mono modules
-> applicationDidFinishLaunching()
The assembly mscorlib.dll was not found or could not be loaded.
It should have been installed in the `/var/mobile/Applications/35E9DF9D-DD67-4F72-896C-3BA5657DEB02/GameCreator.app/Data/mono/1.0/mscorlib.dll' directory.

I’ll check to see what is happening with mscorlib.dll

I just realized I didn’t answer one of your questions.

I can build and run the remote, I can not build and run any sample apps.

I am still unable to figure out what is happening here.

Hello, I am having the exact same problem.

I can build the unity remote, but nothing from within unity will build.

the problem is in the custom script running before the build in xCode:

rm -rf “$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Data”
cp -Rf “$BUILT_PRODUCTS_DIR/…/Data” “$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Data”

checking the xCode build transcript:
setenv BUILT_PRODUCTS_DIR /Applications/devBuilds

the /Applications/devBuilds directory is probably not exactly where you want to be grabbing the ‘Data’ file from. However, I dont know what I should change this to so that it will work. (I am a unity Newb, just downloaded the trial yesterday)

Any more info would be much appreciated!
thanks!
-Ben

Just move your project to your user folder or the shared folder.
Additionally, when using build in unity, ensure that the app is in the same project folder but OUTSIDE the asset folder

that two things should do the magic

dreamora, thanks for the speedy reply, however I have my app inside the project but outside the asset folder…

However! I did figure out what was happening:
Looks like if you go into your xCode prefs → build prefs be sure that the
under Place Build Product in:
you have the ‘Project Directory’ set. (this is the ‘default’ setting)

The right env var to use in that script should be PROJECT_DIR

so the script:
rm -rf “$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Data”
cp -Rf “$PROJECT_DIR/Data” “$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Data”

works with either Place Build Product setting.

cheers and thanks again!
-ben

That did it.

Thanks for the help everyone!

I downloaded the iPhone trial today and hit the same problem. Can the issue with the build script as noted by benbritten in the post above be fixed? I have my build output set to a shared location so I can use static libs with my iPhone builds, so this is a major inconvenience to have to change it back and forth.