Reputation: 10759
I have included the TokBox framework in my project so we can do video SMS. The issue is that the framework along with some others they require will not let you compile or run the app in the simulator; they are not supported.
Is there a way to set a compiler flag to skip the TokBox and other frameworks when compiling to the simulator? The reason is I need to test our app on iPhone 4, 4s 5, 5s and whatever devices that come out Sept 9th. I don't own one of each type of phone.
Getting this error:
file was built for archive which is not the architecture being linked (i386)
I add this to my OTHER LINKER FLAGS for "Any iOS Simulator SKD" but still failing
"-ObjC -framework MobileCoreServices -framework SystemConfiguration -framework OpenTok"
Upvotes: 5
Views: 6570
Reputation: 10759
Here are the steps to fix this.
Make OpenTok framework optional from the Build Phases > Link Binary With Libraries instead of required.
You may need to remove the OpenTok framework from Project Navigator and Link Binary With Libraries, then clean then add back and make it optional.
In Build Settings > Linking in "Other Linker Flags" you should have a Debug and Release. Under Debug add a new one and choose "Any iOS Simulator SDK" on the right side type this -weak_framework OpenTok
Then in all the classes that reference open talk you need to do something like this.
#if TARGET_IPHONE_SIMULATOR
@interface TokBoxVideoViewController (){
NSMutableDictionary *allStreams;
NSMutableDictionary *allSubscribers;
NSMutableArray *allConnectionsIds;
OTSession *_session;
OTPublisher *_publisher;
OTSubscriber *_currentSubscriber;
CGPoint _startPosition;
BOOL initialized;
}
#else
@interface TokBoxVideoViewController ()<OTSessionDelegate, OTSubscriberKitDelegate,
OTPublisherDelegate>{
NSMutableDictionary *allStreams;
NSMutableDictionary *allSubscribers;
NSMutableArray *allConnectionsIds;
OTSession *_session;
OTPublisher *_publisher;
OTSubscriber *_currentSubscriber;
CGPoint _startPosition;
BOOL initialized;
}
#endif
Upvotes: 4