Solving “Duplicate Symbol” Error When Setting Up GorillaLogic’s FoneMonkey 5

I’m trying out GorillaLogic’s FoneMonkey 5 to see how it’s going to help us with automated testing for the iOS applications. Documentation on how to set it up is adequate but missed out on a scenario wherein a static library is used on another static library. My iOS project is, of course, working prior to setting up FoneMonkey as described in the documentation. After setting up and running Build, I get Duplicate Symbol error in the build console which is similar to this and this happens during linking.

ld: duplicate symbol _OBJC_IVAR_$_<ClassName>.<ClassProperty> in /Users/<username>/Library/Developer/Xcode/DerivedData/<ProjectName>-eatcdudkfbhgupaknrguharwtxze/Build/Products/Debug-iphonesimulator/lib<StaticLibraryName>.a(<ClassName>.o) and /Users/<username>/Library/Developer/Xcode/DerivedData/<ProjectName>-eatcdudkfbhgupaknrguharwtxze/Build/Products/Debug-iphonesimulator/lib<StaticLibraryName>.a(<ClassName>.o) for architecture i386

The scenario is this:

  1. Static Library A and Static Library B are referenced by My Project.
  2. Static Library A is referenced by Static Library B.

When you use the –all_load in the Other Linker Flag as the documentation instructed, you’ll get the duplicate symbol error. When you remove it, your project will compile but won’t show the FoneMonkey console in your app.

The solution is to replace –all_load with –force_load <path>/libFoneMonkey.5.0b.a. Replace <path> with the path to your libFoneMonkey.5.0b.a relative to your app’s Xcode project. Here’s an excerpt from the Mac OS X Developer Library that explains the difference between –all_load and –force_load:

-all_load forces the linker to load all object files from every archive it sees, even those without Objective-C code. -force_load is available in Xcode 3.2 and later. It allows finer grain control of archive loading. Each -force_load option must be followed by a path to an archive, and every object file in that archive will be loaded.

There it is! I hope I saved you some headache!

I’m still in the exploration stage. It looks promising! Feel free to share your thoughts on FoneMonkey.

This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

2 Responses to Solving “Duplicate Symbol” Error When Setting Up GorillaLogic’s FoneMonkey 5

  1. stustern says:


    We weren’t aware of this issue. We’ll update the FoneMonkey doc accordingly.

    Stu Stern
    FoneMonkey Project Founder

  2. Ed Schwarz says:

    Hi Jojit,

    Thanks for this! We will definitely incorporate this into our documentation.

    Best of luck with FoneMonkey, please keep posting and let us know how it’s working for you.

    – Ed

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s