Can not build iphone examples in Xcode

Hello:

I am new to unity 3D and just purchased iOS version. My first step is to build iphone example from Unity to test on my new iPad
After I open exported xcode project and build the project I found compile errors as below:
1.CopyPNGFile “/Users/daniel/Library/Developer/Xcode/DerivedData/Unity-iPhone-btpczbiokyhisceoxardtxrajyco/Build/Products/maze.app/Icon@2x.png” “Icon@2x.png”
cd “/Users/daniel/Documents/AppleDevCodeCenter/Unity iPhone Examples/Roll-a-Ball/Rool-a-Ball-iPhone”
setenv PATH “/Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Volumes/Xcode/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin”
/Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng -compress “” “/Users/daniel/Documents/AppleDevCodeCenter/Unity iPhone Examples/Roll-a-Ball/Rool-a-Ball-iPhone/Icon@2x.png” “/Users/daniel/Library/Developer/Xcode/DerivedData/Unity-iPhone-btpczbiokyhisceoxardtxrajyco/Build/Products/maze.app/Icon@2x.png”

Read ErCommand /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng emitted errors but did not return a nonzero exit code to indicate failure

2.Apple Match-o Linker
error: linker command failed with exit code 1 (use -v to see invocation)

My PC information is as below:
1.Mac OX 10.8.2
2.unity 3.5.6 mac
3.New iPad ios6
4.Xcode4.5.1

Any suggestion is welcome.

Regards,

Daniel Lee 2012/10/04

Danial I am also build same project for iphone but I did not get any problem Its work fine here. Please check your build setting Again.

Without knowing the details of your Unity build settings, I’d say you’re trying to build for both armv6 armv7 processors. armv6 is no longer supported in Xcode 4.5, choose to build only for armv7. For the record, armv6 is the processor used in iPhone 3G and older devices, and apple just made the decision for not allowing software development for those platforms anymore.

I checked the build settings and set to armv7 processor. The compile error reduced to only one link error as below
:Ld /Users/daniel/Library/Developer/Xcode/DerivedData/Unity-iPhone-btpczbiokyhisceoxardtxrajyco/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7s/maze normal armv7s
cd “/Users/daniel/Documents/AppleDevCodeCenter/Unity iPhone Examples/Roll-a-Ball/Rool-a-Ball-iPhone”
setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
setenv PATH “/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -L/Users/daniel/Library/Developer/Xcode/DerivedData/Unity-iPhone-btpczbiokyhisceoxardtxrajyco/Build/Products “-L/Users/daniel/Documents/AppleDevCodeCenter/Unity iPhone Examples/Roll-a-Ball/Rool-a-Ball-iPhone” “-L/Users/daniel/Documents/AppleDevCodeCenter/Unity iPhone Examples/Roll-a-Ball/Rool-a-Ball-iPhone/Libraries” -F/Users/daniel/Library/Developer/Xcode/DerivedData/Unity-iPhone-btpczbiokyhisceoxardtxrajyco/Build/Products -filelist /Users/daniel/Library/Developer/Xcode/DerivedData/Unity-iPhone-btpczbiokyhisceoxardtxrajyco/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7s/maze.LinkFileList -dead_strip -all_load -weak_framework CoreMotion -weak-lSystem -fobjc-link-runtime -miphoneos-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/daniel/Library/Developer/Xcode/DerivedData/Unity-iPhone-btpczbiokyhisceoxardtxrajyco/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7s/maze

ld: file is universal (2 slices) but does not contain a(n) armv7s slice: /Users/daniel/Documents/AppleDevCodeCenter/Unity iPhone Examples/Roll-a-Ball/Rool-a-Ball-iPhone/Libraries/libiPhone-lib.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Above is link error. My mac language is Traditional Chinese and my iPad name is “Daniel的ipad”. Does it make the trouble?
I download unity remote and installed in iPad but i found the unity remote could not connect to my unity 3D.

My unity 3D is free editor plus ios plugin.

Hello:

Can anyone show me the actual meaning of i"d: file is universal (2 slices) but does not contain a(n) armv7s slice" and how to fix it?
I think above link error description might explain the problem.

Regards,

Daniel Lee 2012/10/04

Thanks all:

I finally solve the problem. It is really build settings problem after I remove default processor and add armv7 the problem is solved.

Regards,

Daniel Lee 2012/10/07

The meaning of this is that per XCode 4.5, universal must be ARMV7 + ARMV7s or must not be universal at all. This form of Universal build is not supported by unity at the time.
As such you must ensure to choose ‘ARMV7’ only in the player settings.

ARMV6 (iphone 3g and ealier), which is Unitys universal (ARMV6 + ARMV7) is officially dead and can not be targeted anymore with iOS SDK and its tools and will automatically lead to build errors and additional refusals should you somehow trick the linker, and I’m sure future releases of Unity will properly account for that as Apple will do so for granted.