iOS app crashes when Podfile has 'use_frameworks!' option - ios

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:
PODFILE:
# Uncomment this line to define a global platform for your project
# platform :ios, '6.0'
use_frameworks!
pod 'MBProgressHUD'
pod 'ImojiSDK'
CRASH OUTPUT:
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)

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

The ImojiSDK pod was recently updated for frameworks compatibility.
https://github.com/imojiengineering/imoji-ios-sdk

Related

NSInvalidArgumentException from OIDAuthorizationService when using google signin in SwiftUI

I'm having a terrible day with this unfamiliar error
2020-08-15 10:00:38.630941+0100 Wicrypt[44349:3718177] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[OIDAuthorizationService presentAuthorizationRequest:presentingViewController:callback:]: unrecognized selector sent to class 0x106b47af0'
*** First throw call stack:
(
0 CoreFoundation 0x0000000107dfb4b2 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x0000000107a4b26e objc_exception_throw + 48
2 CoreFoundation 0x0000000107e09f12 __CFExceptionProem + 0
3 CoreFoundation 0x0000000107dff9e8 ___forwarding___ + 1479
4 CoreFoundation 0x0000000107e01a18 _CF_forwarding_prep_0 + 120
5 Wicrypt 0x0000000106aac8d2 -[GIDSignIn authenticateInteractivelyWithOptions:] + 626
6 Wicrypt 0x0000000106aacd5f -[GIDSignIn authenticateWithOptions:] + 74
7 Wicrypt 0x0000000106aac59a -[GIDSignIn signInWithOptions:] + 509
8 Wicrypt 0x0000000106aabde6 -[GIDSignIn signIn] + 64
9 Wicrypt 0x000000010671810b $s7Wicrypt18GoogleSignInScreenV4bodyQrvg7SwiftUI9TupleViewVyAE0J0PAEE5frame5width6height9alignmentQr12CoreGraphics7CGFloatVSg_AqE9AlignmentVtFQOyAE6SpacerV_Qo__AiEEAjklMQrAQ_AqStFQOyAE6VStackVyAGyAE4TextV_AZtGG_Qo_AuzE6ButtonVyAZGtGyXEfU_yycfU0_ + 91
10 SwiftUI 0x00000001095e1d91 $s7SwiftUI18WrappedButtonStyle33_AEEDD090E917AC57C12008D974DC6805LLV4BodyV4bodyQrvgyycAA09PrimitivedE13ConfigurationVcfu_yycfu0_TA + 17
11 SwiftUI 0x000000010989c000 $s7SwiftUI25PressableGestureCallbacksV8dispatch5phase5stateyycSgAA0D5PhaseOyxG_SbztFyycfU_ + 32
12 SwiftUI 0x0000000109657bac $sIeg_ytIegr_TR + 12
13 SwiftUI 0x00000001094dc901 $sIeg_ytIegr_TRTA + 17
14 SwiftUI 0x00000001094fbcd9 $sIeg_ytIegr_TRTA.1980 + 9
15 SwiftUI 0x0000000109657bcc $sytIegr_Ieg_TR + 12
16 SwiftUI 0x0000000109657bac $sIeg_ytIegr_TR + 12
17 SwiftUI 0x000000010964a791 $sIeg_ytIegr_TRTA + 17
18 SwiftUI 0x000000010964a044 $s7SwiftUI6UpdateO3endyyFZ + 436
19 SwiftUI 0x0000000109688a9d $s7SwiftUI19EventBindingManagerC4sendyySDyAA0C2IDVAA0C4Type_pGF + 301
20 SwiftUI 0x0000000109ac2a9c $s7SwiftUI18EventBindingBridgeC4send_6sourceySDyAA0C2IDVAA0C4Type_pG_AA0cD6Source_ptFTf4nen_nAA22UIKitGestureRecognizerC_Tg5 + 2060
21 SwiftUI 0x0000000109ac0782 $s7SwiftUI22UIKitGestureRecognizerC4send025_062C14327F4C9197D92807A7H6DF7F3BLL7touches5event5phaseyShySo7UITouchCG_So7UIEventCAA10EventPhaseOtF + 66
22 SwiftUI 0x0000000109ac15e3 $s7SwiftUI22UIKitGestureRecognizerC12touchesBegan_4withyShySo7UITouchCG_So7UIEventCtFToTm + 131
23 SwiftUI 0x0000000109ac0858 $s7SwiftUI22UIKitGestureRecognizerC12touchesEnded_4withyShySo7UITouchCG_So7UIEventCtFTo + 40
24 UIKitCore 0x000000011388b2f5 -[UIGestureRecognizer _componentsEnded:withEvent:] + 217
25 UIKitCore 0x0000000113dd2162 -[UITouchesEvent _sendEventToGestureRecognizer:] + 674
26 UIKitCore 0x000000011387f6fb __47-[UIGestureEnvironment _updateForEvent:window:]_block_invoke + 70
27 UIKitCore 0x000000011387f380 -[UIGestureEnvironment _updateForEvent:window:] + 489
28 UIKitCore 0x0000000113d84bb8 -[UIWindow sendEvent:] + 4752
29 UIKitCore 0x0000000113d5e7dd -[UIApplication sendEvent:] + 408
30 UIKitCore 0x0000000113dee8c0 __processEventQueue + 15007
31 UIKitCore 0x0000000113de5398 __eventFetcherSourceCallback + 106
32 CoreFoundation 0x0000000107d69b04 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
33 CoreFoundation 0x0000000107d69a43 __CFRunLoopDoSource0 + 157
34 CoreFoundation 0x0000000107d69187 __CFRunLoopDoSources0 + 222
35 CoreFoundation 0x0000000107d63c68 __CFRunLoopRun + 882
36 CoreFoundation 0x0000000107d63542 CFRunLoopRunSpecific + 538
37 GraphicsServices 0x0000000111c15db3 GSEventRunModal + 139
38 UIKitCore 0x0000000113d4014e -[UIApplication _run] + 912
39 UIKitCore 0x0000000113d451b1 UIApplicationMain + 101
40 Wicrypt 0x00000001066f786b main + 75
41 libdyld.dylib 0x000000010e009411 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[OIDAuthorizationService presentAuthorizationRequest:presentingViewController:callback:]: unrecognized selector sent to class 0x106b47af0'
terminating with uncaught exception of type NSException
CoreSimulator 732.7 - Device: iPhone 11 (7A79AEEA-ED4B-4DCD-BC33-81C73615B7A7) - Runtime: iOS 14.0 (18A5332e) - DeviceType: iPhone 11
I have set the necessary delegate
GIDSignIn.sharedInstance()?.delegate = googleDelegate
I have also set the presenting controller properly
GIDSignIn.sharedInstance()!.presentingViewController = window.rootViewController
The closest resource I've seen is: https://openid.github.io/AppAuth-iOS/docs/latest/category_o_i_d_authorization_service_07_i_o_s_08.html#details
Please any help or reference will be resourceful
This may be this necessary step from docs if you don't use pods:
Add the ObjC linker flag to the app target's build settings:
Other Linker Flags: $(OTHER_LDFLAGS) -ObjC
The method that is being called, is present in this file.
If your runtime can not find this method, it means that this file is not included into the project.
If you are using CocoaPods, this file should be automatically included for ios platform. Please insure that you specify
platform :ios, '13.0'
in your Podfile.
We don't need to add -ObjC in OTHER_LINKER_FLAGS nor include AppAuthCore.framework in the app target's "Linked frameworks and libraries".
Adding AppAuth.framework alone is sufficient. (and in the associated carthage copy-frameworks Run Script phase.)"
(Based on the ratkins' comment on AppAuth's Git forum)

Xcode Swift error with Braintree SDK

I'm trying to integrate the braintree sdk payment system into my app. I've done everything in the instructions (https://developers.braintreepayments.com/guides/drop-in/ios/v3) and I'm getting a strange error. Here's my code:
#IBAction func purchase(sender: AnyObject) {
let dropInViewController: BTDropInViewController = braintree!.dropInViewControllerWithDelegate(self)
dropInViewController.navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Cancel, target: self, action: Selector("userDidCancel"))
dropInViewController.summaryTitle = "Pass"
dropInViewController.summaryDescription = "Purchase the product"
dropInViewController.displayAmount = "$5"
var navigationController: UINavigationController = UINavigationController(rootViewController: dropInViewController)
self.presentViewController(navigationController, animated: true, completion: nil)
}
and here's the error I'm getting when I touch the button to show the Braintree Drop In View
2015-12-15 20:06:39.764 TheDiner[1169:22409] +[UIColor bt_colorWithBytesR:G:B:]: unrecognized selector sent to class 0x104e4abc8
2015-12-15 20:06:39.828 TheDiner[1169:22409] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIColor bt_colorWithBytesR:G:B:]: unrecognized selector sent to class 0x104e4abc8'
*** First throw call stack:
(
0 CoreFoundation 0x000000010565bc65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001061dcbb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000105662fad +[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00000001055b913c ___forwarding___ + 988
4 CoreFoundation 0x00000001055b8cd8 _CF_forwarding_prep_0 + 120
5 TheDiner 0x0000000103004f70 -[BTUI borderColor] + 64
6 TheDiner 0x0000000102fd8564 -[BTDropInContentView initWithFrame:] + 964
7 UIKit 0x00000001040d7393 -[UIView init] + 62
8 TheDiner 0x00000001030f794e -[BTUIThemedView init] + 62
9 TheDiner 0x0000000102fe0cb2 -[BTDropInViewController initWithClient:] + 226
10 TheDiner 0x0000000102fbfba1 -[Braintree dropInViewControllerWithDelegate:] + 209
11 TheDiner 0x0000000102fa9e7c _TFC8TheDiner22ZiftPassViewController16purchaseZiftPassfS0_FPSs9AnyObject_T_ + 572
12 TheDiner 0x0000000102faa206 _TToFC8TheDiner22ZiftPassViewController16purchaseZiftPassfS0_FPSs9AnyObject_T_ + 54
13 UIKit 0x0000000104075d62 -[UIApplication sendAction:to:from:forEvent:] + 75
14 UIKit 0x000000010418750a -[UIControl _sendActionsForEvents:withEvent:] + 467
15 UIKit 0x00000001041868d9 -[UIControl touchesEnded:withEvent:] + 522
16 UIKit 0x00000001040c2958 -[UIWindow _sendTouchesForEvent:] + 735
17 UIKit 0x00000001040c3282 -[UIWindow sendEvent:] + 682
18 UIKit 0x0000000104089541 -[UIApplication sendEvent:] + 246
19 UIKit 0x0000000104096cdc _UIApplicationHandleEventFromQueueEvent + 18265
20 UIKit 0x000000010407159c _UIApplicationHandleEventQueue + 2066
21 CoreFoundation 0x000000010558f431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
22 CoreFoundation 0x00000001055852fd __CFRunLoopDoSources0 + 269
23 CoreFoundation 0x0000000105584934 __CFRunLoopRun + 868
24 CoreFoundation 0x0000000105584366 CFRunLoopRunSpecific + 470
25 GraphicsServices 0x0000000107c0fa3e GSEventRunModal + 161
26 UIKit 0x00000001040748c0 UIApplicationMain + 1282
27 TheDiner 0x0000000102fbea37 main + 135
28 libdyld.dylib 0x000000010694d145 start + 1
29 ??? 0x0000000000000001 0x0 + 1
)
I'm using Xcode 6 for ios8. I have the braintree header file in the bridging header.
#import <Braintree/Braintree.h>
#endif
Please point me in the right direction I've been stuck on this for a few hours. I'm thinking maybe I need to import another header in my bridge file but when I do it gives errors as well. Thanks
So the issue causing the crash is this:
5 TheDiner 0x0000000103004f70 -[BTUI borderColor] + 64
It appears that borderColor is a class method on BTUI, but that method calls +[UIColor bt_colorWithBytesR:G:B:], and the runtime can't find the implementation for +[UIColor bt_colorWithBytesR:G:B:]. This method is defined in UIColor+BTUI.h
Make sure you that you were able to import all of the headers for Brain Tree in the bridging header if you are using swift.
Try importing the header for the category file UIColor+BTUI.h manually in the bridging header and do a clean build and try again....
Updated Steps:
I got this to work, looks like something is messed up in your project file... I ran into the same problems you were having. But try these steps:
1) Create a new xcode project, (no need for bridged headers file).
2) Then change your podfile to:
use_frameworks!
pod 'Braintree', '~> 3.9'
then do a pod update
3)then at the top of your ViewController class add import Braintree then do a clean build

AudioKit unexpected crash ios with swift on AKOscillator - [AKOscillator operationName]: unrecognized selector sent to instance

I am receiving a strange crash when using AudioKit to build a Swift based ios 8 application. I followed all the videos and am able to successfully build and launch an AudioKit based project using the bridging header, etc. Now in my main ViewController, I have just the following code based on the hello world example:
override func viewDidLoad() {
super.viewDidLoad()
let inst = AKInstrument()
//let oscillator = AKOscillator()
//inst.setAudioOutput(oscillator)
//AKOrchestra.addInstrument(inst)
//inst.play()
}
That runs fine, but the second that I uncomment the lines below initializing the AKInstrument, I get a crash shortly after my app launches:
0dBFS level = 32768.0
Csound version 6.05 (float samples) Aug 6 2015
libsndfile-1.0.26pre6
2015-10-22 11:19:15.024 NILG5[1281:37425] 1 MIDI sources
2015-10-22 11:19:15.025 NILG5[1281:37425] MIDI source 0: Session 1
440.0
2015-10-22 11:19:16.072 NILG5[1281:36836] -[AKOscillator operationName]: unrecognized selector sent to instance 0x7fb6904b78b0
2015-10-22 11:19:16.160 NILG5[1281:36836] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AKOscillator operationName]: unrecognized selector sent to instance 0x7fb6904b78b0'
*** First throw call stack:
(
0 CoreFoundation 0x0000000110094c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000111c64bb7 objc_exception_throw + 45
2 CoreFoundation 0x000000011009c0ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010fff213c ___forwarding___ + 988
4 CoreFoundation 0x000000010fff1cd8 _CF_forwarding_prep_0 + 120
5 NILG5 0x000000010f43d14b -[AKOscillator init] + 43
6 NILG5 0x000000010f430790 _TTOFCSo12AKOscillatorcfMS_FT_S_ + 16
7 NILG5 0x000000010f42c2c7 _TFCSo12AKOscillatorCfMS_FT_S_ + 71
8 NILG5 0x000000010f42b564 _TFC5NILG514ViewController11viewDidLoadfS0_FT_T_ + 308
9 NILG5 0x000000010f42b6e2 _TToFC5NILG514ViewController11viewDidLoadfS0_FT_T_ + 34
10 UIKit 0x0000000110ac91d0 -[UIViewController loadViewIfRequired] + 738
11 UIKit 0x0000000110ac93ce -[UIViewController view] + 27
12 UIKit 0x00000001109e4289 -[UIWindow addRootViewControllerViewIfPossible] + 58
13 UIKit 0x00000001109e464f -[UIWindow _setHidden:forced:] + 247
14 UIKit 0x00000001109f0de1 -[UIWindow makeKeyAndVisible] + 42
15 UIKit 0x0000000110994417 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2732
16 UIKit 0x000000011099719e -[UIApplication _runWithMainScene:transitionContext:completion:] + 1349
17 UIKit 0x0000000110996095 -[UIApplication workspaceDidEndTransaction:] + 179
18 FrontBoardServices 0x0000000116ce95e5 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 21
19 CoreFoundation 0x000000010ffc841c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
20 CoreFoundation 0x000000010ffbe165 __CFRunLoopDoBlocks + 341
21 CoreFoundation 0x000000010ffbdf25 __CFRunLoopRun + 2389
22 CoreFoundation 0x000000010ffbd366 CFRunLoopRunSpecific + 470
23 UIKit 0x0000000110995b02 -[UIApplication _run] + 413
24 UIKit 0x00000001109988c0 UIApplicationMain + 1282
25 NILG5 0x000000010f430ee7 main + 135
26 libdyld.dylib 0x00000001123a6145 start + 1
27 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Seems like its complaining about [AKOscillator operationName]: unrecognized selector sent to instance 0x7fb6904b78b0 ... but the docs clearly allow you to initialize an AKOscillator without any parameters...
Not sure, any ideas??

PayPal integrated iOS 8 App

I have downloaded and played with the github project for the paypal ios app.
https://github.com/paypal/PayPal-iOS-SDK
I ran it just fine without any errors. When I try to link it into my iOS 8 swift project I can load all the files and connect the view controllers just fine and I believe my bridge header file is working just fine. I basically moved all the viewcontroller files from the sample app into my project and just connected what I needed to. I have the client id and secret id working I believe. It is when I try to create a FuturePaymentViewController :
- (IBAction)getUserAuthorizationForFuturePayments:(id)sender {
NSLog(#"\n\n\nbegin getting user authorization\n\n\nPAYPAL CONFIG:::: %#", self.payPalConfig);
PayPalFuturePaymentViewController *futurePaymentViewController = [[PayPalFuturePaymentViewController alloc] initWithConfiguration:self.payPalConfig delegate:self];
//breaks here when trying to send the config init.
NSLog(#"\n\n\nafter initializtion of paypal future payment view controller\n\n\n");
[self presentViewController:futurePaymentViewController animated:YES completion:nil];
NSLog(#"after present");
}
Error I get is :
PAYPAL CONFIG:::: <PayPalConfiguration: 0x7fb23e212af0>
2014-10-12 16:31:38.979 Project[2161:69146] -[PayPalFuturePaymentViewController payPalServiceManager]: unrecognized selector sent to instance 0x7fb23e2207d0
2014-10-12 16:31:38.981 Project[2161:69146] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PayPalFuturePaymentViewController payPalServiceManager]: unrecognized selector sent to instance 0x7fb23e2207d0'
*** First throw call stack:
(
0 CoreFoundation 0x00000001055bf3f5 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000105258bb7 objc_exception_throw + 45
2 CoreFoundation 0x00000001055c650d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010551e7fc ___forwarding___ + 988
4 CoreFoundation 0x000000010551e398 _CF_forwarding_prep_0 + 120
5 CutInLineSwift 0x000000010262c0b1 -[PayPalFuturePaymentViewController initWithConfiguration:delegate:] + 361
6 CutInLineSwift 0x00000001025d28de -[ZZMainViewController getUserAuthorizationForFuturePayments:] + 190
7 UIKit 0x00000001029639ee -[UIApplication sendAction:to:from:forEvent:] + 75
8 UIKit 0x0000000102a69bd0 -[UIControl _sendActionsForEvents:withEvent:] + 467
9 UIKit 0x0000000102a68f9f -[UIControl touchesEnded:withEvent:] + 522
10 UIKit 0x00000001029a93b8 -[UIWindow _sendTouchesForEvent:] + 735
11 UIKit 0x00000001029a9ce3 -[UIWindow sendEvent:] + 683
12 UIKit 0x0000000102976ae1 -[UIApplication sendEvent:] + 246
13 UIKit 0x0000000102983bad _UIApplicationHandleEventFromQueueEvent + 17370
14 UIKit 0x000000010295f233 _UIApplicationHandleEventQueue + 1961
15 CoreFoundation 0x00000001054f4ad1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
16 CoreFoundation 0x00000001054ea99d __CFRunLoopDoSources0 + 269
17 CoreFoundation 0x00000001054e9fd4 __CFRunLoopRun + 868
18 CoreFoundation 0x00000001054e9a06 CFRunLoopRunSpecific + 470
19 GraphicsServices 0x00000001071eb9f0 GSEventRunModal + 161
20 UIKit 0x0000000102962550 UIApplicationMain + 1282
21 CutInLineSwift 0x00000001025d093e top_level_code + 78
22 CutInLineSwift 0x00000001025d097a main + 42
23 libdyld.dylib 0x0000000105f93145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
This should not be breaking since no different from the sample project but I have no idea why it is. Please help me, thank you!
Dave from PayPal here.
I believe that your problem will be solved by step 3 of our integration instructions:
In your project's Build Settings (in the TARGETS section, not the PROJECTS section):
add -lc++ -ObjC to Other Linker Flags
Also, please note Step 1 of our sample code, which indicates that you must call [PayPalMobile initializeWithClientIdsForEnvironments:] to initialize the SDK, prior to calling other methods.

SDWebImage in a simple test app crashes with NSInvalidArgumentException

In Xcode 5.0.2
I create a blank single view app for iPhone,
then add a "male.png" image to the project,
drag a UIImageView to the storyboard
and finally add the following code to the viewDidLoad:
_imageView.image = [UIImage imageNamed:#"male.png"];
This works well:
Then I add the files from SDWebImage project and change the ViewController.m to:
#import "ViewController.h"
#import <SDWebImage/UIImageView+WebCache.h>
static NSString* const kAvatar = #"http://gravatar.com/avatar/55b3816622d935e50098bb44c17663bc.png";
#interface ViewController ()
#end
#implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[_imageView setImageWithURL:[NSURL URLWithString:kAvatar]
placeholderImage:[UIImage imageNamed:#"male.png"]];
}
#end
Unfortunately, this results in app crash with the error message:
2014-01-11 19:21:57.731 sdImage[2563:70b] -[UIImageView setImageWithURL:placeholderImage:]: unrecognized selector sent to instance 0x8a5aa80
2014-01-11 19:21:57.745 sdImage[2563:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView setImageWithURL:placeholderImage:]: unrecognized selector sent to instance 0x8a5aa80'
*** First throw call stack:
(
0 CoreFoundation 0x017395e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x014bc8b6 objc_exception_throw + 44
2 CoreFoundation 0x017d6903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0172990b ___forwarding___ + 1019
4 CoreFoundation 0x017294ee _CF_forwarding_prep_0 + 14
5 sdImage 0x00002b43 -[ViewController viewDidLoad] + 227
6 UIKit 0x0033e318 -[UIViewController loadViewIfRequired] + 696
7 UIKit 0x0033e5b4 -[UIViewController view] + 35
8 UIKit 0x002669fd -[UIWindow addRootViewControllerViewIfPossible] + 66
9 UIKit 0x00266d97 -[UIWindow _setHidden:forced:] + 312
10 UIKit 0x0026702d -[UIWindow _orderFrontWithoutMakingKey] + 49
11 UIKit 0x0027189a -[UIWindow makeKeyAndVisible] + 65
12 UIKit 0x00224cd0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1851
13 UIKit 0x002293a8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
14 UIKit 0x0023d87c -[UIApplication handleEvent:withNewEvent:] + 3447
15 UIKit 0x0023dde9 -[UIApplication sendEvent:] + 85
16 UIKit 0x0022b025 _UIApplicationHandleEvent + 736
17 GraphicsServices 0x036e02f6 _PurpleEventCallback + 776
18 GraphicsServices 0x036dfe01 PurpleEventCallback + 46
19 CoreFoundation 0x016b4d65 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
20 CoreFoundation 0x016b4a9b __CFRunLoopDoSource1 + 523
21 CoreFoundation 0x016df77c __CFRunLoopRun + 2156
22 CoreFoundation 0x016deac3 CFRunLoopRunSpecific + 467
23 CoreFoundation 0x016de8db CFRunLoopRunInMode + 123
24 UIKit 0x00228add -[UIApplication _run] + 840
25 UIKit 0x0022ad3b UIApplicationMain + 1225
26 sdImage 0x00002ffd main + 141
27 libdyld.dylib 0x01d7770d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Why does it happen please? While adding the framework files I have set the checkbox to copy the files.
UPDATE:
I have also tried the following:
git submodule add https://github.com/rs/SDWebImage.git
then built that project (SDWebImage.xcodeproj) and closed it.
Then I have reopened in Xcode my project (sdImage.xcodeproj) and dragged the SDWebImage.xcodeproj file into it.
After that I have tried to add a Target Dependency, but it doesn't show anything named "SDWebImage" there:
Here the full sized screenshot.
And I can not add an "SDWebImage.framework" under Link Binary With Libraries, because nothing named "SDWebImage" is there.
Why don't you just include the SDWebImage source files in your main project? This is how I incorporated SDWebImage, and the SDWebImage docs themselves state: "There are two ways to use this in your project: copy all the files into your project, or import the project as a static library." If you do this there is no need to open the SDWebImage project, compile the framework, link the framework with your project, etc.
I've got the project by using CocoaPods with the following Podfile:
platform :ios, '5.0'
pod 'SDWebImage'
and then running pod install and opening sdImage.xcworkspace in Xcode.
I'm still interested in how to use SDWebImage in a project - without using CocoaPods...

Resources