I’ve also run into a similar problem trying to get the example iOS plugin code working. I’ve been looking all over the web and the forums for a solution but haven’t found anything, although I have seen several other posts with people experiencing this problem. I’ve been stuck on this for a couple of days so if anyone has any ideas I’d love to hear them. Details below:
I’m trying to build the Bonjour iOS
plugin example found here
http://unity3d.com/support/documentation/Images/manual/iPhoneNativeCodeSample.zip
Linked to from this page
I’m using Unity iPhone Basic Version 3.1.0f4 (55865) and XCode 3.2.5
Building to an iPhone running iOS 4.2.1 (8C148). Here are the steps
I’ve taken when trying to build the project:
- Unzip
- Open iPhoneNativeCodeSample/Asets/scene.unity
- “Upgrading project!” prompt appears, I select Continue
- Test Run in Editor appears to work fine with no error/warning
messages and a Bonjour client dialog box appears
- Change Player Settings
5a) Company Name: bigmutantant
5b) Productname: appname
5c) Bundle Identifier: com.bigmutantant.appname
5d) SDK Version iPhone OS 4.2
5e) I leave Bundle Version at default of 1.0
5f) I leave Target iOS Version at 3.0
- I select build and run without checking the Debug Build box
- Build to the directory PhoneNativeCodeSample/AppName
- I get the following errors from XCode
Build Unity-iPhone of project Unity-iPhone with configuration Release
Check dependencies
[BWARN]warning: all apps should include an armv7 architecture (current
ARCHS = “armv6”).
Ld build/appname.app/appname normal armv6
cd /Users/malex/Desktop/iPhoneNativeCodeSample/appname
setenv IPHONEOS_DEPLOYMENT_TARGET 3.0
setenv PATH “/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin”
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g+±4.2 -arch
armv6 -isysroot
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk
-L/Users/malex/Desktop/iPhoneNativeCodeSample/PlasmaBlast/build
-L/Users/malex/Desktop/iPhoneNativeCodeSample/PlasmaBlast
-L/Users/malex/Desktop/iPhoneNativeCodeSample/PlasmaBlast/Libraries
-F/Users/malex/Desktop/iPhoneNativeCodeSample/PlasmaBlast/build
-filelist /Users/malex/Desktop/iPhoneNativeCodeSample/PlasmaBlast/build/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv6/appname.LinkFileList
-dead_strip -Wl,-S,-x -miphoneos-version-min=3.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 -liPhoneNetwork -o
/Users/malex/Desktop/iPhoneNativeCodeSample/PlasmaBlast/build/appname.app/appname
Undefined symbols:
“__GetServiceName”, referenced from:
__GetServiceName$non_lazy_ptr in RegisterMonoModules.o
(maybe you meant: __GetServiceName$non_lazy_ptr)
“__StartLookup”, referenced from:
__StartLookup$non_lazy_ptr in RegisterMonoModules.o
(maybe you meant: __StartLookup$non_lazy_ptr)
“__GetServiceCount”, referenced from:
__GetServiceCount$non_lazy_ptr in RegisterMonoModules.o
(maybe you meant: __GetServiceCount$non_lazy_ptr)
“__Stop”, referenced from:
__Stop$non_lazy_ptr in RegisterMonoModules.o
(maybe you meant: __Stop$non_lazy_ptr)
“__GetLookupStatus”, referenced from:
__GetLookupStatus$non_lazy_ptr in RegisterMonoModules.o
(maybe you meant: __GetLookupStatus$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status
I’ve also tried setting Target Platform to “Universal armv6 + armv7”
and Target IOS Version “4.2” and “Debug Build” with both Release and
Debug in XCode. But no matter what I try, I still get the same
errors. Unity does not show any errors. From what I can tell this
might be an error with how the library is being linked, such as the
symbols not being made available externally. One last issue that I
also noticed is that while the Bundle Identifier was correct on the
first build, on subsequent builds I get the error:
Can’t install application
The Info.plist for application at
/Users/malex/Desktop/iPhoneNativeCodeSample/PlasmaBlast/build/appname.app
specifies a CFBundleExecutable of appname, which does not exist
and have to open the Info.plist and change the Bundle Identifier from
“com.bigmutantant.${PRODUCT_NAME:identifier}” to
“com.bigmutantant.appname”. While this second error is just
moderately annoying, the first one is a big show stopper for me.