2

I am using a third party framework in my app (metaioSDK) and it's not provided in i386 version. I was hoping to be able to exclude it from simulator builds so that I can test functionality unrelated to this framework on the simulator. I followed the answer in this question: How to exclude frameworks in simulator builds in Xcode and made sure to wrap any code that uses this framework in #if/#else/#endif like this:

// ARViewController.h
#import <UIKit/UIKit.h>
#if TARGET_IPHONE_SIMULATOR
@interface ARViewController : UIViewController {
}
@end

#else

#import <metaioSDK/MetaioCloudPlugin/MetaioCloudPluginViewController.h>

@interface ARViewController : MetaioCloudPluginViewController
{
    bool    m_useLocationAtStartup;
}
@end

#endif

Similarly, I've changed the related ARViewController.m file to have a blank implementation when running on simulator.

Yet, Xcode still appears to want to link some portions of this framework, and I get errors:

Undefined symbols for architecture i386:
  "_fopen$UNIX2003", referenced from:
      _BIO_new_file in metaioSDK(bss_file.o)
      _file_ctrl in metaioSDK(bss_file.o)
      _open_console in metaioSDK(ui_openssl.o)
  "_fputs$UNIX2003", referenced from:
      _write_string in metaioSDK(ui_openssl.o)
      _read_string in metaioSDK(ui_openssl.o)
  "_fwrite$UNIX2003", referenced from:
      _XrAQWOpNWyNOaebKZvBRbL in metaioSDK(pngwio.o)
      _file_write in metaioSDK(bss_file.o)
      _int_rsa_verify in metaioSDK(rsa_sign.o)
      _send_fp_chars in metaioSDK(a_strex.o)
      _write_fp in metaioSDK(b_dump.o)
      _read_string in metaioSDK(ui_openssl.o)
  "_nanosleep$UNIX2003", referenced from:
      boost::this_thread::hiden::sleep_for(timespec const&) in metaioSDK(thread.o)
      boost::this_thread::hiden::sleep_until(timespec const&) in metaioSDK(thread.o)
  "_strerror$UNIX2003", referenced from:
      _build_SYS_str_reasons in metaioSDK(err.o)
  "_strtod$UNIX2003", referenced from:
      _WWOVfTQLpCQpcac in metaioSDK(pngrutil.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What else am I missing aside from marking this framework as optional?

Community
  • 1
  • 1
SaltyNuts
  • 5,068
  • 8
  • 48
  • 80

2 Answers2

3

The problem is that your third party framework DOES include an i386 version, but that i386 version was built against the wrong SDK. It was built against the OS X SDK and should have been built against the iOS Simulator SDK. File a bug report with the metaioSDK developers to get them to fix the bug.

Jeremy Huddleston Sequoia
  • 22,938
  • 5
  • 78
  • 86
1

If you duplicate your target and remove the framework from the linked frameworks list, you can use this new target to build for simulator. It's a little less "just know what I want and do the thing", but it'll definitely solve your issue and the relationship will be explicitly marked.

Ian MacDonald
  • 13,472
  • 2
  • 30
  • 51