Reputation: 1346
I have a Single View app setup with CocoaPods that includes only two pods, 'MBProgressHUB' and 'ImojiSDK'.
When CocoaPods is setup as a static library, the project builds and runs normally. When I configure CocoaPods to use frameworks, by including the 'use_frameworks!' flag in the Podfile, the project builds, but crashes when run.
Question is, why does it run fine as a static library, but not when using frameworks?
The crash happens when I try to create a new ImojiSDK session in the view's viewDidLoad:
IMImojiSession *session = [IMImojiSession imojiSession]; //THIS IS WHERE IT CRASHES
session.contentCache = [[NSCache alloc] init];
session.contentCache.countLimit = 100;
Below are the Podfile and crash output from Xcode:
# Uncomment this line to define a global platform for your project
# platform :ios, '6.0'
use_frameworks!
pod 'MBProgressHUD'
pod 'ImojiSDK'
2015-07-20 14:05:18.031 imoji[19887:323843] +[BFTask im_concurrentBackgroundTaskWithBlock:]: unrecognized selector sent to class 0x1041b6878
2015-07-20 14:05:18.035 imoji[19887:323843] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[BFTask im_concurrentBackgroundTaskWithBlock:]: unrecognized selector sent to class 0x1041b6878'
*** First throw call stack:
(
0 CoreFoundation 0x0000000104aafc65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000104746bb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000104ab6fad +[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000104a0d13c ___forwarding___ + 988
4 CoreFoundation 0x0000000104a0ccd8 _CF_forwarding_prep_0 + 120
5 imoji 0x0000000104003962 -[IMMutableImojiSessionStoragePolicy performCleanupOnOldImages] + 93
6 imoji 0x0000000104002c4f -[IMMutableImojiSessionStoragePolicy initWithCachePath:persistentPath:] + 175
7 imoji 0x000000010400ec6d +[IMImojiSessionStoragePolicy temporaryDiskStoragePolicy] + 210
8 imoji 0x0000000104003dfc -[IMImojiSession init] + 76
9 imoji 0x000000010400e8c7 +[IMImojiSession imojiSession] + 41
10 imoji 0x0000000103fd6b8c -[ViewController viewDidLoad] + 76
11 UIKit 0x000000010526d1d0 -[UIViewController loadViewIfRequired] + 738
12 UIKit 0x000000010526d3ce -[UIViewController view] + 27
13 UIKit 0x0000000105188289 -[UIWindow addRootViewControllerViewIfPossible] + 58
14 UIKit 0x000000010518864f -[UIWindow _setHidden:forced:] + 247
15 UIKit 0x0000000105194de1 -[UIWindow makeKeyAndVisible] + 42
16 UIKit 0x0000000105138417 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2732
17 UIKit 0x000000010513b19e -[UIApplication _runWithMainScene:transitionContext:completion:] + 1349
18 UIKit 0x000000010513a095 -[UIApplication workspaceDidEndTransaction:] + 179
19 FrontBoardServices 0x00000001085585e5 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 21
20 CoreFoundation 0x00000001049e341c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
21 CoreFoundation 0x00000001049d9165 __CFRunLoopDoBlocks + 341
22 CoreFoundation 0x00000001049d8f25 __CFRunLoopRun + 2389
23 CoreFoundation 0x00000001049d8366 CFRunLoopRunSpecific + 470
24 UIKit 0x0000000105139b02 -[UIApplication _run] + 413
25 UIKit 0x000000010513c8c0 UIApplicationMain + 1282
26 imoji 0x0000000103fd6fef main + 111
27 libdyld.dylib 0x0000000106579145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Upvotes: 0
Views: 1609
Reputation: 147
The ImojiSDK pod was recently updated for frameworks compatibility. https://github.com/imojiengineering/imoji-ios-sdk
Upvotes: 0
Reputation: 6212
use_frameworks!
enables Swift support by building your code in the new dynamic frameworks. Dynamic frameworks only support iOS 8
CocoaPods 0.36 - Framework and Swift Support
Upvotes: 3