3

I'm trying to integrate my project into Travis CI, and my builds have failed with the following errors:

Undefined symbols for architecture i386 and Undefined symbols for architecture x86_64

I get these errors for basically every class in my project that hasn't been added to the test target under Target Membership. I could probably solve this by adding every single .m file as a member of the test target, but that doesn't really make much sense, and my

I've tried to replicate this issue locally by running both of the following commands:

xcodebuild -workspace myWorkspace.xcworkspace -scheme MyProjectTests -sdk iphonesimulator build test

xctool -workspace myWorkspace.xcworkspace -scheme MyProjectTests -sdk iphonesimulator build test

Using xcodebuild, it works, runs, and the tests pass. Using xctool the tests fail with the same errors that Travis is using, as Travis uses xctool.

Does anyone have any ideas if there's a best fix for this issue? I assume I missed something somewhere, but I followed the standard Travis 'Getting Started' walkthrough.

Mike
  • 9,765
  • 5
  • 34
  • 59

1 Answers1

5

After fussing with this a bunch with no luck, it appears as though I'm able to set a custom script for Travis to use instead.. As mentioned, the xcodebuild worked, so I added the following to my travis.yml file and everything was all good:

script:
 - xcodebuild -workspace myWorkspace.xcworkspace -scheme MyProjectTests -sdk iphonesimulator build test
Mike
  • 9,765
  • 5
  • 34
  • 59
  • Hey Mike, don't know how much this is going to help you now, but the [Travis-CI article on objc.io](http://www.objc.io/issue-6/travis-ci.html) covers this issue, if you add `ONLY_ACTIVE_ARCH=NO` I believe it will also resolve your problem – Louis Tur Apr 30 '15 at 14:28
  • @LouisTur thanks for the heads up, I believe at this point I've actually done that - I'll have to go check. Thanks! – Mike Apr 30 '15 at 14:29