TUploadFile: crash while uploading video file which is picked from the library - ios

My application crashes when user try to upload a video to Quickblox server, after picking the video from the library. The same method works flawlessly if we try to upload an image or video captured from the camera. Thoughts?
Environment details
"QB-SDK" = "iOS 2.2.2";
"QuickBlox-REST-API-Version" = "0.1.1";
Did this work before?
Yes
Expected behavior
Video should upload successfully, or an error should be returned.
Actual behavior
Application crash.
Logs
json: {"blob":{"name":"video","content_type":"video\/quicktime"}}
Request URL:https://api.quickblox.com/blobs.json
Request method: POST
Request parameters:{
blob = {
"content_type" = "video/quicktime";
name = video;
};
}
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType _enableCropOverlayIfNecessary]: unrecognized selector sent to instance 0x7fcd54526650'
*** First throw call stack:
(
0 CoreFoundation 0x0000000105745d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000108f3bdeb objc_exception_throw + 48
2 CoreFoundation 0x000000010574ed3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000105694cfa ___forwarding___ + 970
4 CoreFoundation 0x00000001056948a8 _CF_forwarding_prep_0 + 120
5 PhotoLibrary 0x000000011f852a50 -[PLVideoRemaker _exportCompletedWithSuccess:] + 135
6 AssetsLibraryServices 0x0000000115768709 __pl_dispatch_async_block_invoke + 25
7 libdispatch.dylib 0x000000010a837d9d _dispatch_call_block_and_release + 12
8 libdispatch.dylib 0x000000010a8583eb _dispatch_client_callout + 8
9 libdispatch.dylib 0x000000010a8401ef _dispatch_main_queue_callback_4CF + 1738
10 CoreFoundation 0x000000010569f0f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
11 CoreFoundation 0x0000000105660b99 __CFRunLoopRun + 2073
12 CoreFoundation 0x00000001056600f8 CFRunLoopRunSpecific + 488
13 GraphicsServices 0x000000010afaead2 GSEventRunModal + 161
14 UIKit 0x000000010754bf09 UIApplicationMain + 171
15 MyApp 0x00000001043cc85f main + 111
16 libdyld.dylib 0x000000010a88d92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Steps to reproduce the behavior
Call the upload method for video that is picked from the library:
+ (QBRequest *)TUploadFile:(NSData*)data
fileName:(NSString*)fileName
contentType:(NSString*)contentType
isPublic:(BOOL)isPublic
successBlock:(void(^)(QBResponse *response, QBCBlob* blob))successBlock
statusBlock:(QBRequestStatusUpdateBlock)statusBlock
errorBlock:(void(^)(QBResponse *response))errorBlock;

Related

App Crash Immediately after initiating Quickblox video call from web to iOS app

I have try to video call using QuickBlox from web page to iOS app but when I am call from web immediately iOS app crash with as below log.
[3553:77957] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFConstantString count]: unrecognized selector sent to instance 0x10e546c78'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23c7127e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff513fbb20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23c91fd4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff23c75c4c ___forwarding___ + 1436
4 CoreFoundation 0x00007fff23c77f78 _CF_forwarding_prep_0 + 120
5 libswiftFoundation.dylib 0x000000010f8849f5 $sSD10FoundationE26_forceBridgeFromObjectiveC_6resultySo12NSDictionaryC_SDyxq_GSgztFZ + 709
6 libswiftFoundation.dylib 0x000000010f8789e3 $sSD10FoundationE36_unconditionallyBridgeFromObjectiveCySDyxq_GSo12NSDictionaryCSgFZ + 67
7 ProjectDemo 0x000000010d71912a $s15ProjectDemo6HomeVCC20didReceiveNewSession_8userInfoySo12QBRTCSessionC_SDyS2SGSgtFTo + 138
8 CoreFoundation 0x00007fff23c7820c __invoking___ + 140
9 CoreFoundation 0x00007fff23c753af -[NSInvocation invoke] + 319
10 CoreFoundation 0x00007fff23c75684 -[NSInvocation invokeWithTarget:] + 68
11 Quickblox 0x000000010e4cb67e qb_jid + 89448
12 libdispatch.dylib 0x000000010fb97dd4 _dispatch_call_block_and_release + 12
13 libdispatch.dylib 0x000000010fb98d48 _dispatch_client_callout + 8
14 libdispatch.dylib 0x000000010fba6de6 _dispatch_main_queue_callback_4CF + 1500
15 CoreFoundation 0x00007fff23bd4049 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
16 CoreFoundation 0x00007fff23bceca9 __CFRunLoopRun + 2329
17 CoreFoundation 0x00007fff23bce066 CFRunLoopRunSpecific + 438
18 GraphicsServices 0x00007fff384c0bb0 GSEventRunModal + 65
19 UIKitCore 0x00007fff48092d4d UIApplicationMain + 1621
20 ProjectDemo 0x000000010d75a98b main + 75
21 libdyld.dylib 0x00007fff5227ec25 start + 1
22 ??? 0x0000000000000001 0x0 + 1
)
2020-09-01 09:56:40:474 ProjectDemo[3553:1260b] SEND: <a xmlns="urn:xmpp:sm:3" h="2"/>
libc++abi.dylib: terminating with uncaught exception of type NSException
Most likely, the issue is related to outdated Javascript SDK.
Per our check, your Javascript SDK version is 2.8.1. Please update SDK to the latest version 2.12.9: https://github.com/QuickBlox/quickblox-javascript-sdk
Also, make sure that you are using the latest iOS SDK version 2.17.4: https://github.com/QuickBlox/quickblox-ios-sdk

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: deleting current dictionary

When I try to run the project in Xcode 8.1 , I am facing below error (See logs). I cleaned up the code and did reset the simulator but that didn't work.
** Assertion failure in -[KeychainItemWrapper resetKeychainItem], /Users/manishpathak/iosProjects/MyProject/MyProject/KeychainItemWrapper.m:202
2017-07-14 15:09:09.521 MyProject[26741:3318830] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Problem deleting current dictionary.'
*** First throw call stack:
(
0 CoreFoundation 0x00000001054ba34b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000104f1b21e objc_exception_throw + 48
2 CoreFoundation 0x00000001054be442 +[NSException raise:format:arguments:] + 98
3 Foundation 0x0000000104ab1e4d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 AppifyViewer 0x000000010278b542 -[KeychainItemWrapper resetKeychainItem] + 2354
5 AppifyViewer 0x0000000102713494 +[MDXKeychain storeToKeychain:withPassword:] + 292
6 AppifyViewer 0x00000001027b3a59 -[MDXSecurityPolicy saveCredential:] + 281
7 AppifyViewer 0x0000000102718f37 __32-[MDXLoginViewController login:]_block_invoke + 407
8 AppifyViewer 0x000000010285ed19 __76-[RXPromise registerWithExecutionContext:onSuccess:onFailure:returnPromise:]_block_invoke_3 + 89
9 libdispatch.dylib 0x0000000108140980 _dispatch_call_block_and_release + 12
10 libdispatch.dylib 0x000000010816a0cd _dispatch_client_callout + 8
11 libdispatch.dylib 0x000000010814a8d6 _dispatch_main_queue_callback_4CF + 406
12 CoreFoundation 0x000000010547e4f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
13 CoreFoundation 0x0000000105443f8d __CFRunLoopRun + 2205
14 CoreFoundation 0x0000000105443494 CFRunLoopRunSpecific + 420
15 GraphicsServices 0x0000000109faba6f GSEventRunModal + 161
16 UIKit 0x00000001067df964 UIApplicationMain + 159
17 AppifyViewer 0x00000001027a4857 main + 231
18 libdyld.dylib 0x00000001081b668d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Solution
It's working after Enabling KeyChain Sharing.
Enable Keychain Sharing
1- Click Targetof the project
2- Click on tab Capabilities and search Keychain sharing.
3- Enable Keychain sharing.

Objective-C category for NSMutableDictionary not being respected in iOS10

I have an app written in Objective-C with a category for NSMutableDictionary. In iOS9, the app works fine. However when run in iOS10, the app crashes due to an 'unrecognized selector sent to instance'. I've isolated the problem to the NSMutableDictionary category not being respected in iOS10.
The category for NSMutableDictionary includes the following method:
- (id)getObjectForStringKeyPath:(NSString *)keysPath {
NSArray *dividedString = [keysPath componentsSeparatedByString:#"/"];
return [self getObjectForKeyPath:dividedString];
}
The line which it is crashing at is (response is type 'id'):
NSArray *textArray = [response getObjectForStringKeyPath:"someText/text"];
I've checked the response from the server and the response is valid. Also as I mentioned the crash does not happen on iOS9. It only happens on iOS10.
Does anyone know how to solve this, or any approaches to take for this problem?
Crash log
-[__NSSingleEntryDictionaryI getObjectForStringKeyPath:]: unrecognized selector sent to instance 0x608000a3f3e0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSSingleEntryDictionaryI getObjectForStringKeyPath:]: unrecognized selector sent to instance 0x608000a3f3e0'
*** First throw call stack:
(
0 CoreFoundation 0x000000011036034b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010fdc121e objc_exception_throw + 48
2 CoreFoundation 0x00000001103cff34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00000001102e5c15 ___forwarding___ + 1013
4 CoreFoundation 0x00000001102e5798 _CF_forwarding_prep_0 + 120
5 XYZApp 0x000000010c919b7e __64-[XYZController configureConditionsTextFromHTML:]_block_invoke + 126
6 XYZApp 0x000000010c8e973f __41-[XYZDataProvider getTermsAndConditions:]_block_invoke + 159
7 XYZApp 0x000000010c8fd5ae -[XYZManager handleSuccessfulResponse:andResponseBlock:] + 110
8 XYZApp 0x000000010c8fbede __50-[XYZManager GET:withParameters:andResponseBlock:]_block_invoke + 126
9 libdispatch.dylib 0x0000000110872980 _dispatch_call_block_and_release + 12
10 libdispatch.dylib 0x000000011089c0cd _dispatch_client_callout + 8
11 libdispatch.dylib 0x000000011087ca1d _dispatch_main_queue_callback_4CF + 733
12 CoreFoundation 0x00000001103244f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
13 CoreFoundation 0x00000001102e9f8d __CFRunLoopRun + 2205
14 CoreFoundation 0x00000001102e9494 CFRunLoopRunSpecific + 420
15 GraphicsServices 0x00000001131c9a6f GSEventRunModal + 161
16 UIKit 0x000000010e573f34 UIApplicationMain + 159
17 XYZApp 0x000000010c92698f main + 111
18 libdyld.dylib 0x00000001108e868d start + 1
19 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
The error says that the object type is __NSSingleEntryDictionaryI, not the NSMutableDictionary that you expect.
Make a mutable copy of the dictionary that the server gives you and assign that to response.
For some undocumented reason, iOS10 believes the object type is an NSDictionary, so I created a category for NSDictionary with the getObjectForStringKeyPath method. This was the cleanest and most efficient solution for my problem.

Can't log my t setAccessToken

I want to make a new object from string access_token.
I've made a Token:NSObject (.h + .m) and I'm trying to setAccessToken and show it in the NSLog. This is the code in my LoginViewController.m:
NSString *token = responseObject[#"access_token"];
Token *t = [[Token alloc]init];
[t setAccessToken:token];
NSLog(t);
And this is the error i get:
Create[29485:770358] -[Token _fastCStringContents:]: unrecognized
selector sent to instance 0x7f8e815d0780
Create[29485:770358] * Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[Token _fastCStringContents:]:
unrecognized selector sent to instance 0x7f8e815d0780'
* First throw call stack: ( 0 CoreFoundation 0x000000010149ff45 exceptionPreprocess + 165 1 libobjc.A.dylib
0x0000000100f19deb objc_exception_throw + 48 2 CoreFoundation
0x00000001014a856d -[NSObject(NSObject) doesNotRecognizeSelector:] +
205 3 CoreFoundation 0x00000001013f5eea
___forwarding_ + 970 4 CoreFoundation 0x00000001013f5a98 _CF_forwarding_prep_0 + 120 5
libsystem_trace.dylib 0x00000001036e8327
os_log_shim_with_CFString + 120 6 CoreFoundation
0x000000010148ef24 _CFLogvEx3 + 132 7 Foundation
0x0000000100b9489e _NSLogv + 117 8 Foundation
0x0000000100ae40f2 NSLog + 152 9 Create
0x00000001004d665b 21-[LoginVC UserLogin:]_block_invoke + 203 10
Create 0x00000001004d7f18
__64-[AFHTTPRequestOperation setCompletionBlockWithSuccess:failure:]_block_invoke49 + 40 11
libdispatch.dylib 0x00000001033fde5d
_dispatch_call_block_and_release + 12 12 libdispatch.dylib 0x000000010341e49b _dispatch_client_callout + 8 13 libdispatch.dylib
0x00000001034062af _dispatch_main_queue_callback_4CF + 1738 14
CoreFoundation 0x00000001014002e9
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 15 CoreFoundation 0x00000001013c18a9 __CFRunLoopRun
+ 2073 16 CoreFoundation 0x00000001013c0e08 CFRunLoopRunSpecific + 488 17 GraphicsServices
0x00000001056dcad2 GSEventRunModal + 161 18 UIKit
0x000000010184c30d UIApplicationMain + 171 19 Create
0x00000001004d6a2f main + 111 20 libdyld.dylib
0x000000010345292d start + 1 21 ???
0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with
uncaught exception of type NSException
Hope somebody can help me out!
NSLog(...) function assumes the first argument is an instance of NSString. If you want to use a different object, either use:
NSLog([t description]) or a format string NSLog(#"%#", t).

error with Core Data and iCloud

I am trying to work with Core Data and iCloud.
It worked once and it did not again.
I got this error below :
2015-05-19 12:11:13.695 Student Notebook App[34617:992535] -[Student_Notebook_App.NotebookTableView persistentStoreWillChange]: unrecognized selector sent to instance 0x7f86495514b0
2015-05-19 12:11:13.737 Student Notebook App[34617:992535] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Student_Notebook_App.NotebookTableView persistentStoreWillChange]: unrecognized selector sent to instance 0x7f86495514b0'
*** First throw call stack:
(
0 CoreFoundation 0x0000000110638c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010ff15bb7 objc_exception_throw + 45
2 CoreFoundation 0x00000001106400ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000011059613c ___forwarding___ + 988
4 CoreFoundation 0x0000000110595cd8 _CF_forwarding_prep_0 + 120
5 CoreFoundation 0x000000011060854c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
6 CoreFoundation 0x0000000110506a04 _CFXNotificationPost + 2484
7 Foundation 0x000000010fa6c968 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
8 CoreData 0x0000000110303d5b __81-[PFUbiquitySetupAssistant tryToReplaceLocalStore:withStoreSideLoadedByImporter:]_block_invoke + 283
9 libdispatch.dylib 0x00000001131f5614 _dispatch_client_callout + 8
10 libdispatch.dylib 0x00000001131e02fa _dispatch_barrier_sync_f_slow_invoke + 275
11 libdispatch.dylib 0x00000001131f5614 _dispatch_client_callout + 8
12 libdispatch.dylib 0x00000001131dda1c _dispatch_main_queue_callback_4CF + 1664
13 CoreFoundation 0x00000001105a01f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
14 CoreFoundation 0x0000000110561dcb __CFRunLoopRun + 2043
15 CoreFoundation 0x0000000110561366 CFRunLoopRunSpecific + 470
16 GraphicsServices 0x0000000114e91a3e GSEventRunModal + 161
17 UIKit 0x0000000110c73900 UIApplicationMain + 1282
18 Student Notebook App 0x000000010f923aa7 main + 135
19 libdyld.dylib 0x0000000113229145 start + 1
20 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Please, anyone can help me??
Thanks in Advance
The error is pretty clear:
-[Student_Notebook_App.NotebookTableView persistentStoreWillChange]: unrecognized selector sent to instance 0x7f86495514b0
This says that your code is trying to call a method named persistentStoreWillChange on a class that doesn't have that method.
The stack trace indicates that this happened when a notification was posted. It doesn't say which one. What happened is:
You registered to observe a notification with a method named persistentStoreWillChange.
Later that notification was posted. The notification system tried to call persistentStoreWillChange, but the method did not exist.
When you register for a notification, the callback method name that you provide must exist.

Resources