XCode 4.5 - Undefined symbols for architecture arm

2019-09-18 10:14发布

问题:

I'm brand new to iOS development, and I've been given the task of updating a legacy app to iOS6. The app was built with Unity. In XCode 4.5, when I try to run the Unity-iPhone app on my device (iPhone 4), I get this error:

Xcode cannot run using the selected device.
Choose a destination with a supported architecture in order to run on this device.

I went to the build settings for the target, and noticed that armv6 was set for architectures and valid architectures. I changed both of these settings to be Standard(armv7, armv7s). When I tried to run the project, I got 104 compiler errors like this one:

Undefined symbols for architecture armv7:
  "ForceInclude_BaseBehaviourManager()", referenced from:
      RegisterManagerClasses() in RegisterClasses.o

So, it's not just a matter of importing the right frameworks into the project. These are all methods in one of the source files. How can they be undefined for armv7? Also, how would one solve this issue?

回答1:

NOTE: For running app in device the device IOS version must match with the IOS DEPLOYEMENT TARGET see below image:

Just change the IOS DEPLOYEMENT TARGET with Your Device IOS.

Select Project->Select Info(tab)->select the IOS deployment Target from the drop down box

ALSO NOTE :Xcode 4.5 (and later) does not support generating armv6 binaries.



回答2:

I'm not sure what version of the Unity engine you are using, but does it support armv7?

Because if it does not, and it only supports armv6, then you will have to downgrade your Xcode version so that you use a compiler that compiles armv6 binaries, because Xcode 4.5 doesn't do this.

If you are using a version of Unity which supports armv7, then you need to set your minimum deployment version to iOS4.3



回答3:

try architecture armv6 and armv7
clean the project
build again.