1

is there a tutorial on how to build the Sample Unity AR Project on iOS? I'm obviously missing a few steps, because after dragging the Editor folder to the project Asset folder, hitting Build and Run and saving the build in the actual project folder, Xcode still give's me an a few warnings and an several errors:

    Undefined symbols for architecture armv7:

  "RobotVision::AREngine::startVision()", referenced from:

      __ARUNBridgeStartVisionEngine in ARUNBridge.o

  "RobotVision::VirtualSphero::locatorAlignmentAngle() const", referenced from:

      ARUNBridge::getCurrentResultStruct() in ARUNBridge.o

  "RobotVision::VirtualSphero::pose() const", referenced from:

      ARUNBridge::getCurrentResultStruct() in ARUNBridge.o

  "RobotVision::ARResult::virtualSphero() const", referenced from:

      ARUNBridge::getCurrentResultStruct() in ARUNBridge.o

  "RobotVision::Pose::position() const", referenced from:

      ARUNBridge::getCurrentResultStruct() in ARUNBridge.o


  (...)


      ARUNBridge::initializeBridge(RobotVision::PlatformParameters) in ARUNBridge.o

ld: symbol(s) not found for architecture armv7

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Thanks a lot for your help!

3 Answers3

0

Be sure you are building you xcode project at the same level in your filesystem as the project's Assets folder, the postprocessbuildplayer script makes some assumptions about where you build the xcodeproj and it has to be at that level.

For example if your assets folder is here:

/myproject/Assets

Your xcodeproj file should be here

/myproject/generatedProject/Unity-iPhone.xcodeproj
Jon C
  • 605
  • 6
  • 14
  • Yes, it is on the same folder as the Asset folder. It was missing the linker flags, but as soon as I updated them, the error was that it was missing "AppController.h". Just coping the file to the Classes folder didn`t did the trick, cause the error now is: Undefined symbols for architecture armv7: "_sMotionManager", referenced from: -[ARUNBridge_iOS initializeEngineWithCameraMode:] in ARUNBridge.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) Thanks! – user2913944 Nov 04 '13 at 05:04
  • Are you using Unity 4.x? The current AR SDK was designed to work with Unity 3.5.7, it hasn't been updated yet to support Unity 4.x. – Jon C Nov 05 '13 at 00:04
  • Yes, I`m using Unity 4.2.2 and XCode 5. I`ll try on the 3.5.7. Thanks! – user2913944 Nov 05 '13 at 14:06
  • Still getting the same error: Undefined symbols for architecture armv7: "_sMotionManager" with Unity 3.5.6f4 and XCode 4.6.3. If I try to build it for armv6, I get "Xcode cannot run using the selected device. Choose a destination with a supported architecture in order to run on this device. – user2913944 Nov 05 '13 at 17:31
  • Two more things try, be sure you re-build the project (not append). Also try changing your deployment target in xcode/unity settings to iOS 6.0. – Jon C Nov 05 '13 at 17:52
  • I re-build the project again, and tested setting it to iOS6.0 in Unity and XCode, and still the same error. Does it matter that I`m building it for an iPad Retina? – user2913944 Nov 05 '13 at 18:47
0

The following steps resolved my issues (similar to both the original post and the first answer):

1) made sure my project was Unity 3.5.7 (I had tried continuing work in 4.2.2, I had to revert any project settings changes via git, and delete the Library and obj directories)

2) delete the existing project (in the folder than contains the Assets director, I was building into a directory ios which I deleted)

3) XCode appeared to keep some settings/intermediary files around. I had to select Product->Clean whilst holding down alt (alt will change the "Clean" entry into "Clean Build Folder").

At this point the _sMotionManager linker error went away, but I got a bunch of linker errors mentioning i386 symbols. To get rid of these I simply:

4) Make sure your build target is a device and not the simulator. The simulator for iOS builds x86 binaries rather than arm ones and the robot/vision libraries were only compiled for ARM.

I hope this helps, I was resurrecting an AR project today and stumbled across this thread.

Patrick Martin
  • 2,993
  • 1
  • 13
  • 11
0

maybe you can delete:

extern CMMotionManager *sMotionManager;

and add:

CMMotionManager *sMotionManager;

between @implementation ARUNBridge_iOS and @end

or put it to @interface in it's .h file