Can't Build in Xcode 4.2

I have Unity 3.4.2f2 and just updated to Xcode 4.2 (Mac OS 10.6.8). I’d been holding off updating Xcode and my original iPad to iOS 5.x, but I just got a new iPad 2 and had no choice but to update Xcode.

Now I have a bunch of apps that I need to build and install on the new iPad using Xcode 4.2. I registered my iPad’s UDID for all the provisioning profiles and should have all the necessary permissions and certificates set up. But when I build the app, I get hundreds of linker errors, a few of which are shown below.

Also, when I look at my iPad in Xcode it tells me it cannot find the software image to install this version.

Any suggestions? I don’t know what to do about any of these errors.

I just bought a new Macbook pro with Lion, and had to install 4.2 too.
Had no problems with it, i think it just doesnt support armv6 any more. Don´t know how this is on 10.6 though.

But it looks like your target Build settings are not ok. Please check your Build Settings Architectures. Should be armv7. (or armv7 + armv6 if that is still there).
Your errors sound more like you have everythings set to desktop cpus.

And i would create a new project with just nothing and Build and run that, just to see if that works. if yes, great. If no, well, fxck.
if it works, then your problem is around the older buildsettings.

But i am really not to sure.

Edit:
XCode 4 anyways confuses me a lot.

Settings have not changed – Arm7, iPad only, Net 2.0 subset, SDK is iOS latest, target is 4.0, and include Symlink Unity libraries.

Yeah thats what you set up in unity. But is this also correctly setup in the resulting xCode Project. I think its somehow messed up there.

I never did get that app working, but did get two others building and running under Xcode 4.2. Now another one is giving me an Apple Mach-O Linker error, failed with code 1. I have no idea what that means. This app is very similar to one I already got working and all player settings are the same.

Finally got back to that first problem project and got it running. You were correct Marjan, settings were screwed up. Seems to be a new problem with Xcode. After doing a few projects now, it looks like build settings are randomly changed. Some build right away, and others need to be tweaked. Some projects get set to simulator for no apparent reason.

But I’m still stuck on this one from my last post. Settings are all correct, and I’m not getting hundreds of errors. Just this one error that I have no idea what it means. Which means I don’t know where to begin trouble shooting.

You’re telling the linker ‘ld’ with -l to link in library called z.1.2.3 and it can’t find it in the ld search path (LD_LIBRARY_PATH)

I see that, but I still don’t know what it means. I didn’t tell the linker that, Unity did when it created the Xcode project. I have no idea what that file is or what the search path is. Is that an Xcode file or a Unity file?

It should be defined in the env or as a variable in one of those files if not written directly as -lz1.2.3. Do a env and grep the pattern out and do a recursive find and grep out the pattern z.1.2.3

For further help read the man pages for ld clang++ and see what environment variables you need to set to get them to output in verbose mode (if they let you set that kind of behaviour via environment varibles. Some do, some don’t).

Thanks for the suggestions, but I have no idea what you are talking about. I know next to nothing about Xcode (I presume that’s what you’re referring to), and have only used it to build Unity projects. Which up to Xcode 4.2 didn’t have all these build problems.

I did do a Find, and there is no “z.1.2.3” found in the project or frameworks.

I’ve just successfully updated and built four other very similar apps, no problems, no missing z.1.2.3 file.

FWIW, this is a set of physics sims that use the same code, same 2D interface, same plug-ins, same settings, etc. The only difference amongst this set of apps is the 3D models and the scripts that control the physics. So it makes no sense to me why one would require a file that none of the others do, especially a file that I have no idea where it came from.

FWIW, I had issues after upgrading to Xcode 4 and had to rebuild my project with a different name.

So I’m pretty sure then you’ve done a Clean in xcode.

find and grep are unix command line utilities I am used to using rather than a GUI.

I don’t think you will find a library called “z.1.2.3”

so open an xterm or Terminal window and do on the command line:

env | grep ‘z.1.2.3’

good if you get no lines back.

then do

cd
find . -type f -exec grep -l ‘z.1.2.3’ {} ;

Any file with the string ‘z.1.2.3’ will print out you’ll know which files are causing the problem.

And since you say that the only difference between this app and the others are the physics scripts that would be the 1st place I checked. Did you write them or they from an open source library? If they are open source is there a support forum for those scripts? They would know what function is being referenced that would need to have a library called z.1.2.3 linked in.

I solved the problem, but don’t know why. Here’s what I did:

I deleted the iOS player and every other generated file from the project folder and did a fresh build. Same error. I noticed that, unlike the other apps I’d been updating, this problem app was the only one that I’d updated to Xcode 4.2 that DIDN’T come out with simulator set in the scheme. So I switched it TO simulator, did a build, and got the expected LOTS of errors (from the Etcetera plug-in). Then I switched the scheme back to Unity iPhone, and it built with no errors.

FWIW, the only outside code I’m using is Etcetera and EZGUI, and I know they do not require that “missing” library. The physics and all the rest of the code is mine.

That’s good to know. I actually had the opposite problem. I had to change from simulator to iOS build to get the compile to work (which makes alot more sense then what you had to do).

By the way, if that was the cause of your problem that headache and similar headaches should be solved with the release of Unity 3.5 soon.

I’m getting a similar error and no amount of swapping back and forth will clear it

Using Etcetera plugin too. Any other ideas for fixing this?

Ok I got it to build by going to the Unity-Iphone target and then Build phases and removing that library link altogether.

Is this problem similar to yours… can everyone help related to it