XCode 5 + Unity 4.2.2 on OS X 10.8.5

Hey guys,

I tried searching around but didn’t find anything that matched exactly so wanted to see if this is user error on my part or something else…

I’ve been working on a PoC for an iOS project but haven’t had access to OS X for any sort of live testing until this evening. My hope was to gauge performance in the Simulator. I was able to get my hands on a MacBook Air running OS X 10.8.5, ported my project to a fresh install of Unity 4.2.2, and built a version of the game and threw it into XCode 5. This is pretty much a pristine OS X install I’m playing with at this stage.

I went through most Player Settings within Unity prior to hitting Build, most notably:

  • Target Resolution : iPhone + iPad.
  • SDK Version : Simulator SDK.
  • Target iOS Version : Numerous, including 4.3, 6.0, etc.

I opened the project in XCode via Finder, and have tried numerous simulation settings but I constantly hit the following error in there:
Undefined Symbols for architecture i386:
“DebugStringToFile(char const*, int, … )”, references from:
prcore::Surface::ClearImage(prcore …)
prcore::Surface::BlitImage(prcore…)
ld: symbols(s) not found for architecture i386
clang: error: linker command failed with exit code 1

I wondered if it was my Unity Project so I fired up the Angry Bots demo and got the same result so I’m curious if this is something stupid (I’m fumbling through the OS X stuff at the moment) on my end, or if this is among the teething issues with XCode 5 that I’ve read some of since researching this.

I can’t find anything searching for “unity” and “debugstringtofile” in google so I’m at a loss.

Any thoughts on if an earlier version of XCode will be of use?

Apologies in advance if this is the wrong place to dump this question.

Thanks,
Greg

I back-levelled Xcode to 4.6.3, fully removing Xcode 5 and attempted to run this in Unity-iPhone → iPhone 6.1 Simulator and it failed in exactly the same way.

The colleague who loaned me the MacBook Air informed me that OS X 10.8.5 is pretty new as well - has anyone had any luck deploying to Xcode from Unity 4.2.2?

Thanks,
Greg

Just in case it’s useful to have the full error I’m getting:
Ld /Users/mainuser/Library/Developer/Xcode/DerivedData/Unity-iPhone-aghucglfqoigfjabbekqalsriszr/Build/Products/angryBots.app/angryBots normal i386
cd /Users/Shared/Unity/4-0_AngryBots/blah
setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
setenv PATH “/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin”
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -L/Users/mainuser/Library/Developer/Xcode/DerivedData/Unity-iPhone-aghucglfqoigfjabbekqalsriszr/Build/Products -L/Users/Shared/Unity/4-0_AngryBots/blah -L/Users/Shared/Unity/4-0_AngryBots/blah/Libraries -F/Users/mainuser/Library/Developer/Xcode/DerivedData/Unity-iPhone-aghucglfqoigfjabbekqalsriszr/Build/Products -filelist /Users/mainuser/Library/Developer/Xcode/DerivedData/Unity-iPhone-aghucglfqoigfjabbekqalsriszr/Build/Intermediates/Unity-iPhone.build/Debug-iphonesimulator/Unity-iPhone.build/Objects-normal/i386/angryBots.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -weak_framework CoreMotion -weak-lSystem -stdlib=libstdc++ -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.0 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework OpenAL -liconv.2 -liPhone-lib -framework AudioToolbox -framework CFNetwork -framework MediaPlayer -framework CoreLocation -framework SystemConfiguration -weak_framework iAd -framework CoreMedia -framework CoreVideo -weak_framework AVFoundation -framework CoreGraphics -weak_framework CoreMotion -weak_framework GameKit -o /Users/mainuser/Library/Developer/Xcode/DerivedData/Unity-iPhone-aghucglfqoigfjabbekqalsriszr/Build/Products/angryBots.app/angryBots

Undefined symbols for architecture i386:
“DebugStringToFile(char const*, int, char const*, int, int, int, int, int)”, referenced from:
prcore::Surface::ClearImage(prcore::color32 const, prcore::Surface::ClearMode) in libiPhone-lib.a(blitter_integer.o)
prcore::Surface::BlitImage(prcore::Surface const, prcore::Surface::BlitMode) in libiPhone-lib.a(blitter_integer.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Yesterday I used unity4.1 + xcode5, It was all ok. When upgrade to unity4.2.2f1, problem came out…
Is that a unity4.2.2f1’s bug?

And just as an additional datapoint.

I removed Unity 4.2.2 from the MacBook, installed Unity 4.2.1, and I was able to compile and run the Xcode version of AngryBots with no such issues. This was Xcode 4.6.3, not Xcode 5, emulating an iPhone running iOS 6.0.

heartfollower’s suggestion that this was introduced with Unity 4.2.2f1 appears to have some merit, but I’m afraid I don’t know anywhere near enough about what Unity does with a project and what Xcode is tripping up on to be able to offer any more insight. I’ll have the MacBook AIr for this evening so if anyone wants any additional info let me know, though I suspect this should be reasonably recreatable.

Thanks,
Greg

Having the same issue just after upgrading the Unity 4.2.2 from Unity 4.2.1. :frowning:

I have no experience on OSX but just use it for IOS Unity porting. I also face this problem :(. Hope it is soon answered from someone…

Bump for: same issue same error.

I have the same issue, I tried with the angry bots project and have the same results.

Undefined symbols for architecture i386:
“DebugStringToFile(char const*, int, char const*, int, int, int, int, int)”, referenced from:
prcore::Surface::ClearImage(prcore::color32 const, prcore::Surface::ClearMode) in libiPhone-lib.a(blitter_integer.o)
prcore::Surface::BlitImage(prcore::Surface const, prcore::Surface::BlitMode) in libiPhone-lib.a(blitter_integer.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It works ok with the device.

…Me too, having the exact same issue, only since upgrading today to the super-newest release of Unity (v4.2.2f1) Xcode 5.

When building/running - I’m unable to get it to compile fully; instead it now shows 2 Errors (Preventing it from building/running). The errors are the exact one(s) mentioned above:

Xcode 5 compilation info (Errors):

Undefined symbols for architecture i386:
“DebugStringToFile(char const*, int, char const*, int, int, int, int, int)”, referenced from:
prcore::Surface::ClearImage(prcore::color32 const, prcore::Surface::ClearMode) in libiPhone-lib.a(blitter_integer.o)
prcore::Surface::BlitImage(prcore::Surface const, prcore::Surface::BlitMode) in libiPhone-lib.a(blitter_integer.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

…I’m not a programming wizard, but when building a project in Unity for iOS apps; should the “i386” architecture even be used?

UPDATE:
I finally got some things to work when NOT using a ‘Development Build’; setting the SDK version to ‘Device SDK’; and the Target iOS Version to ‘Unknown’…
And it mostly-ran…However, there are definitely some significant problems with even the newest release of Unity and using it with (at least) XCode 5…

Many of the ‘Player Settings’ that I set in Unity; such as things like the ‘Device Orientation’, and so on - were NOT sent/saved in the Xcode project correctly; and I had to change them in Xcode manually…Which is less than ideal obviously.

Also, it seems that the "Development Build’ setting in Unity causes many other issues (including totally un-compilable projects, which are shown by the many failed build attempts by other people in the messages above…

So finally, it appears that there are still multiple issues that are causing major issues when using Unity and (At least) Xcode 5 together…Glad to know that I’m not alone for once.

same issue.

So current solution is downgrade unity from 4.2.2 to 4.2.1?

Downgrading Unity was the path of least resistance for me…

I think the libPhone.a for simulator is missing the definition of that function “DebugStringToFile”. Sounds like is a easy fix on that.

facing same problem with latest unity , is this forum monitored by unity developers or is there a separate way to raise tickets in failing unity builds?

How is that an easy fix? Can you elaborate? [quote=eric.so, post: 1391910]
I think the libPhone.a for simulator is missing the definition of that function “DebugStringToFile”. Sounds like is a easy fix on that.
[/quote]

Not for me. But I wish Unity developer can fix in the library.

Same problem here… Unity 4.2.2 does not work correctly with xcode… :-x

Submitted a bug report through Unity with a link to this forum.

How long do we have to wait for Unity people to address this issue? A link to this bug report should be on this page since this is the only page that appears when googling this particular error

I have the same issue here. I hope someone can answer on how to fix this issue. I wouldn’t want to downgrade Unity3D.