iOS getting the crash while displaying Facebook video ads - ios

Crash log is here:-
We are simply getting the ads from Facebook Audience Network and showing in list view.
We are using FBMedia view from XIB as demonstrated by Facebook Audience Network sample app. Somehow the AVplayer getting deallocated before removing observer.
Can someone please help on this.
2016-07-19 16:22:02.905 NewsHunt[59124:1425162] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'An instance of AVPlayer cannot remove a time observer that was added by a different instance of AVPlayer.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010bd55d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010b7c9deb objc_exception_throw + 48
2 AVFoundation 0x0000000106c25ee7 -[AVPlayer _removeAllLayers] + 0
3 NewsHunt 0x0000000105c2d721 -[FBAdVideoView removeAllTimingObservers] + 369
4 NewsHunt 0x0000000105c2b167 -[FBAdVideoView playMovieWithURL:withVideoPlayCheck:withVideoTimeCheck:withFailure:] + 183
5 NewsHunt 0x0000000105c5b8df -[FBMediaView loadVideo] + 671
6 NewsHunt 0x0000000105c5b045 -[FBMediaView loadNativeAd:] + 389
7 NewsHunt 0x0000000105c5ae8f -[FBMediaView setNativeAd:] + 431
8 NewsHunt 0x00000001056c0180 -[DHFANAdCommunicator renderAdOnView:andParentViewController:] + 240
9 NewsHunt 0x00000001055e1f8c -[DHMultipleExternalAdResponse renderAdOnView:andParentViewController:] + 124
10 NewsHunt 0x00000001056c3baf -[DHCardP1AdRenderer setAd:onView:] + 143
11 NewsHunt 0x0000000105850113 -[NewsListViewController tableView:willDisplayCell:forRowAtIndexPath:] + 467
12 UIKit 0x00000001095ba59c -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 934
13 UIKit 0x00000001095ba62c -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 74
14 UIKit 0x000000010958ed4f -[UITableView _updateVisibleCellsNow:isRecursive:] + 2996
15 UIKit 0x00000001095c3686 -[UITableView _performWithCachedTraitCollection:] + 92
16 UIKit 0x00000001095aa344 -[UITableView layoutSubviews] + 224
17 UIKit 0x0000000109517980 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703
18 QuartzCore 0x0000000108f8cc00 -[CALayer layoutSublayers] + 146
19 QuartzCore 0x0000000108f8108e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
20 QuartzCore 0x0000000108f80f0c _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
21 QuartzCore 0x0000000108f753c9 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
22 QuartzCore 0x0000000108fa3086 _ZN2CA11Transaction6commitEv + 486
23 QuartzCore 0x0000000108fb1b5c _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 576
24 CoreFoundation 0x000000010bcaf074 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20
25 CoreFoundation 0x000000010bcaec21 __CFRunLoopDoTimer + 1089
26 CoreFoundation 0x000000010bc70b11 __CFRunLoopRun + 1937
27 CoreFoundation 0x000000010bc700f8 CFRunLoopRunSpecific + 488
28 GraphicsServices 0x000000010df72ad2 GSEventRunModal + 161
29 UIKit 0x000000010945cf09 UIApplicationMain + 171
30 NewsHunt 0x0000000105763767 main + 151
31 libdyld.dylib 0x000000010cfeb92d start + 1
32 ??? 0x0000000000000001 0x0 + 1
)

Related

Not able to find crash Swift

App is crashing with these logs, but couldn't able to find what's causing the crash
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull set]: unrecognized selector sent to instance 0x118f33590'
*** First throw call stack:
(
0 CoreFoundation 0x0000000118ccf8ab __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00000001117a5ba3 objc_exception_throw + 48
2 CoreFoundation 0x0000000118cdeab8 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
3 CoreFoundation 0x0000000118cd3d71 ___forwarding___ + 1431
4 CoreFoundation 0x0000000118cd6068 _CF_forwarding_prep_0 + 120
5 UIFoundation 0x0000000125ff888b -[NSCoreTypesetter _NSFastDrawString:length:attributes:paragraphStyle:typesetterBehavior:lineBreakMode:rect:padding:graphicsContext:baselineRendering:usesFontLeading:usesScreenFont:scrollable:syncAlignment:mirrored:boundingRectPointer:baselineOffsetPointer:drawingContext:] + 5857
6 UIFoundation 0x0000000125ffa518 -[NSCoreTypesetter _stringDrawingCoreTextEngineWithOriginalString:rect:padding:graphicsContext:forceClipping:attributes:stringDrawingOptions:drawingContext:stringDrawingInterface:] + 1266
7 UIFoundation 0x0000000125ff1ea8 __NSStringDrawingEngine + 1882
8 UIFoundation 0x0000000125fef7a8 _NSStringDrawingCore + 173
9 UIFoundation 0x0000000125ff31ae -[NSAttributedString(NSExtendedStringDrawing) drawWithRect:options:context:] + 91
10 UIKitCore 0x0000000123c32a50 -[UILabel _drawTextInRect:baselineCalculationOnly:returningDeviceMetricsOfFirstLine:] + 4359
11 UIKitCore 0x0000000123c39393 -[UILabel _drawTextInRect:baselineCalculationOnly:] + 37
12 UIKitCore 0x0000000123c39c3f -[UILabel _drawTextInRect:] + 257
13 UIKitCore 0x0000000123c38e8a -[UILabel drawTextInRect:] + 615
14 UIKitCore 0x0000000123c39cd2 -[UILabel drawRect:] + 70
15 UIKitCore 0x0000000123d0881d -[UIView(CALayerDelegate) drawLayer:inContext:] + 613
16 QuartzCore 0x0000000114c3cd74 CABackingStoreUpdate_ + 223
17 QuartzCore 0x0000000114df5101 ___ZN2CA5Layer8display_Ev_block_invoke + 53
18 QuartzCore 0x0000000114deb29a -[CALayer _display] + 2114
19 QuartzCore 0x0000000114dfe748 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 464
20 QuartzCore 0x0000000114d0fb0c _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 626
21 QuartzCore 0x0000000114d4769b _ZN2CA11Transaction6commitEv + 735
22 QuartzCore 0x0000000114d48b64 _ZN2CA11Transaction25flush_as_runloop_observerEb + 60
23 CoreFoundation 0x0000000118c2e055 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
24 CoreFoundation 0x0000000118c289c2 __CFRunLoopDoObservers + 515
25 CoreFoundation 0x0000000118c28f0d __CFRunLoopRun + 1161
26 CoreFoundation 0x0000000118c286a7 CFRunLoopRunSpecific + 560
27 GraphicsServices 0x000000011d4df28a GSEventRunModal + 139
28 UIKitCore 0x00000001236d6ad3 -[UIApplication _run] + 994
29 UIKitCore 0x00000001236db9ef UIApplicationMain + 123
30 libswiftUIKit.dylib 0x0000000117366c72 $s5UIKit17UIApplicationMainys5Int32VAD_SpySpys4Int8VGGSgSSSgAJtF + 98
31 MyAppName 0x00000001044eb198 $sSo21UIApplicationDelegateP5UIKitE4mainyyFZ + 104
32 MyAppName 0x00000001044eb127 $s19MyAppName11AppDelegateC5$mainyyFZ + 39
33 MyAppName 0x00000001044eb2c8 main + 24
34 dyld 0x000000010e3e52bf start_sim + 10
35 ??? 0x0000000205ea6310 0x0 + 8689181456
)
libc++abi: terminating with uncaught exception of type NSException
Message from debugger: Terminated due to signal 6

Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan 40]'

This is extremely odd. I practically did nothing with the app. Just fixed a constraint and the app loaded just fine and the constraint had taken the effect. Then simply I re-ran the app and got this error. Don't know how to fix it.
First throw call stack:
(
0 CoreFoundation 0x000000010ea2673b __exceptionPreprocess + 331
1 libobjc.A.dylib 0x000000010da1b735 objc_exception_throw + 48
2 CoreFoundation 0x000000010ea26595 +[NSException raise:format:] + 197
3 QuartzCore 0x000000010ef8a923 _ZN2CA5Layer12set_positionERKNS_4Vec2IdEEb + 141
4 QuartzCore 0x000000010ef79a13 -[CALayer setPosition:] + 57
5 QuartzCore 0x000000010ef7a16f -[CALayer setFrame:] + 561
6 UIKitCore 0x0000000117ebf09e -[UIView(Geometry) setFrame:] + 336
7 List24 0x000000010d0c4364 $S6List2414ViewControllerC05tableB0_12cellForRowAtSo07UITableB4CellCSo0iB0C_10Foundation9IndexPathVtF + 836
8 List24 0x000000010d0c46bb $S6List2414ViewControllerC05tableB0_12cellForRowAtSo07UITableB4CellCSo0iB0C_10Foundation9IndexPathVtFTo + 155
9 UIKitCore 0x0000000117d38c1c -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 771
10 UIKitCore 0x0000000117d391a9 -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 73
11 UIKitCore 0x0000000117d002aa -[UITableView _updateVisibleCellsNow:isRecursive:] + 2863
12 UIKitCore 0x0000000117d20f62 -[UITableView layoutSubviews] + 165
13 UIKitCore 0x0000000117ede749 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1441
14 QuartzCore 0x000000010ef80299 -[CALayer layoutSublayers] + 175
15 QuartzCore 0x000000010ef85153 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 395
16 QuartzCore 0x000000010eefdbb2 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 342
17 QuartzCore 0x000000010ef34e62 _ZN2CA11Transaction6commitEv + 576
18 UIKitCore 0x00000001177e1208 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 139
19 CoreFoundation 0x000000010e98a2bc __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
20 CoreFoundation 0x000000010e989a70 __CFRunLoopDoBlocks + 336
21 CoreFoundation 0x000000010e9842e4 __CFRunLoopRun + 1284
22 CoreFoundation 0x000000010e983aa1 CFRunLoopRunSpecific + 625
23 GraphicsServices 0x00000001142531dd GSEventRunModal + 62
24 UIKitCore 0x00000001177c6a4f UIApplicationMain + 140
25 List24 0x000000010d0d0f27 main + 71
26 libdyld.dylib 0x000000011116dced start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

IQDropDownTextField inside UITableView CALayer invalid geometry error

I have a UITableView with multiple cell containing IQDropDownTextField. When I reload the tableview, it crashes occasionally 1 out of 10. Here are my stack traces:
Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer bounds contains NaN: [0 nan; 320 291]'
*** First throw call stack:
(
0 CoreFoundation 0x0000000107c3cd4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010718321e objc_exception_throw + 48
2 CoreFoundation 0x0000000107ca62b5 +[NSException raise:format:] + 197
3 QuartzCore 0x000000010561fc20 _ZN2CA5Layer10set_boundsERKNS_4RectEb + 230
4 QuartzCore 0x000000010561feb5 -[CALayer setBounds:] + 154
5 UIKit 0x00000001059e06c3 -[UIView(Geometry) setBounds:] + 483
6 UIKit 0x0000000105a0caf3 -[UIScrollView setBounds:] + 1255
7 UIKit 0x0000000105a9702b -[UITableView setBounds:] + 282
8 UIKit 0x00000001060e7eb1 -[UIPickerTableView setBounds:] + 120
9 UIKit 0x0000000105a0d0d0 -[UIScrollView setContentOffset:] + 445
10 UIKit 0x0000000105a98092 -[UITableView setContentOffset:] + 316
11 UIKit 0x00000001060e722b -[UIPickerTableView _setContentOffset:notify:] + 93
12 UIKit 0x0000000105a26a7b -[UIScrollView(UIScrollViewInternal) _setContentOffset:animated:animationCurve:animationAdjustsForContentOffsetDelta:] + 957
13 UIKit 0x00000001060e63db -[UIPickerTableView _scrollRowAtIndexPathToSelectionBar:animated:] + 248
14 UIKit 0x00000001060e6764 -[UIPickerTableView selectRow:animated:notify:] + 755
15 UIKit 0x000000010591bb01 -[UIPickerView _selectRow:inComponent:animated:notify:] + 159
16 FindAroundYou 0x0000000102e08d46 -[IQDropDownTextField setSelectedRow:animated:] + 406
17 FindAroundYou 0x0000000102e08ba0 -[IQDropDownTextField setSelectedRow:] + 64
18 FindAroundYou 0x0000000102e09301 -[IQDropDownTextField setItemList:] + 161
19 FindAroundYou 0x0000000102e14a51 -[FAYHomeVC tableView:cellForRowAtIndexPath:] + 2097
20 UIKit 0x0000000105aa5584 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 757
21 UIKit 0x0000000105aa57e2 -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 74
22 UIKit 0x0000000105a792b0 -[UITableView _updateVisibleCellsNow:isRecursive:] + 3295
23 UIKit 0x0000000105aaeb64 -[UITableView _performWithCachedTraitCollection:] + 110
24 UIKit 0x0000000105a953be -[UITableView layoutSubviews] + 222
25 UIKit 0x00000001059fcab8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1237
26 QuartzCore 0x0000000105629bf8 -[CALayer layoutSublayers] + 146
27 QuartzCore 0x000000010561d440 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
28 QuartzCore 0x000000010561d2be _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
29 QuartzCore 0x00000001055ab318 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 280
30 QuartzCore 0x00000001055d83ff _ZN2CA11Transaction6commitEv + 475
31 QuartzCore 0x00000001055d8d6f _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 113
32 CoreFoundation 0x0000000107be1267 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
33 CoreFoundation 0x0000000107be11d7 __CFRunLoopDoObservers + 391
34 CoreFoundation 0x0000000107bc5f8e __CFRunLoopRun + 1198
35 CoreFoundation 0x0000000107bc5884 CFRunLoopRunSpecific + 420
36 GraphicsServices 0x000000010ae1da6f GSEventRunModal + 161
37 UIKit 0x0000000105937c68 UIApplicationMain + 159
38 FindAroundYou 0x0000000102e2fd3f main + 111
39 libdyld.dylib 0x00000001081c768d start + 1
40 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Can someone please help me to figure out why this crash happening? I am not putting code because I don't know which part is causing this issue.

Store the data dynamically in uitableview using sqlite

Code:
NSString *Query=[NSString stringWithFormat:#"select *from peopleinfm where peopleinfmID=%d",TextEdit];
NSArray *Results=[[NSArray alloc]initWithArray:[DBManger loadDataFromDB:Query]];
self.FirstnameText.text=[[Results objectAtIndex:1]objectAtIndex:[self.DBManger.ColumnArray indexOfObject:#"firstname"]];
self.LastnameText.text=[[Results objectAtIndex:1]objectAtIndex:[self.DBManger.ColumnArray indexOfObject:#"lastname"]];
self.AgeText.text=[[Results objectAtIndex:1]objectAtIndex:[self.DBManger.ColumnArray indexOfObject:#"age"]];
Logs:
2016-02-12 19:03:36.068 SampleFMDB[9641:762577] no such table: peopleinfm
2016-02-12 19:03:36.077 SampleFMDB[9641:762577] _UIConstraintBasedLayoutLogUnsatisfiable is OFF
2016-02-12 19:03:37.934 SampleFMDB[9641:762577] no such table: peopleinfm
2016-02-12 19:03:37.978 SampleFMDB[9641:762577] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArray0 objectAtIndex:]: index 1 beyond bounds for empty NSArray'
*** First throw call stack:
(
0 CoreFoundation 0x00b23a94 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x005e2e02 objc_exception_throw + 50
2 CoreFoundation 0x00aca4a0 __CFArrayGetTypeID_block_invoke + 0
3 SampleFMDB 0x00010003 -[AddViewController loadInfoToEdit] + 291
4 SampleFMDB 0x0000f9bc -[AddViewController viewDidLoad] + 396
5 UIKit 0x01070d74 -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 44
6 UIKit 0x010758c2 -[UIViewController loadViewIfRequired] + 1556
7 UIKit 0x0107bf0e -[UIViewController __viewWillAppear:] + 114
8 UIKit 0x0109ecf0 -[UIViewController(UIContainerViewControllerProtectedMethods) beginAppearanceTransition:animated:] + 202
9 UIKit 0x010b0d63 -[UINavigationController _startCustomTransition:] + 1375
10 UIKit 0x010c1c0b -[UINavigationController _startDeferredTransitionIfNeeded:] + 801
11 UIKit 0x010c2d05 -[UINavigationController __viewWillLayoutSubviews] + 68
12 UIKit 0x0128cd9f -[UILayoutContainerView layoutSubviews] + 252
13 UIKit 0x00f7916b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 813
14 libobjc.A.dylib 0x005f7059 -[NSObject performSelector:withObject:] + 70
15 QuartzCore 0x048ae60c -[CALayer layoutSublayers] + 144
16 QuartzCore 0x048a228e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 388
17 QuartzCore 0x048a20f2 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
18 QuartzCore 0x04894c2b _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 317
19 QuartzCore 0x048c8c23 _ZN2CA11Transaction6commitEv + 589
20 QuartzCore 0x048ca484 _ZN2CA11Transaction17flush_transactionEv + 50
21 UIKit 0x00eadb55 _UIApplicationHandleEventQueue + 7921
22 CoreFoundation 0x00a3de7f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
23 CoreFoundation 0x00a33b0b __CFRunLoopDoSources0 + 523
24 CoreFoundation 0x00a32f28 __CFRunLoopRun + 1032
25 CoreFoundation 0x00a32866 CFRunLoopRunSpecific + 470
26 CoreFoundation 0x00a3267b CFRunLoopRunInMode + 123
27 GraphicsServices 0x04148664 GSEventRunModal + 192
28 GraphicsServices 0x041484a1 GSEventRun + 104
29 UIKit 0x00eb3cc1 UIApplicationMain + 160
30 SampleFMDB 0x000108ea main + 138
31 libdyld.dylib 0x030f6a21 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Error with Parse integrated with Swift

When I'm trying to make a social media-like app using Parse, I get the following error when trying to go to the section to compose a "sweet". I'm trying to recreate what is in this video: (https://youtu.be/Q6kTw_cK3zY), and this is the error I am getting in the console output :
*** First throw call stack:
(
0 CoreFoundation 0x0000000105cfdc65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000107868bb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000105cfd8a9 -[NSException raise] + 9
3 Foundation 0x000000010611bb53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 CoreFoundation 0x0000000105c45d50 -[NSArray makeObjectsPerformSelector:] + 224
5 UIKit 0x000000010687452b -[UINib instantiateWithOwner:options:] + 1506
6 UIKit 0x00000001066cc718 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
7 UIKit 0x00000001066ccd08 -[UIViewController loadView] + 109
8 UIKit 0x00000001066ccf79 -[UIViewController loadViewIfRequired] + 75
9 UIKit 0x00000001066cd40e -[UIViewController view] + 27
10 UIKit 0x00000001066f2297 -[UINavigationController _startCustomTransition:] + 633
11 UIKit 0x00000001066fe3bf -[UINavigationController _startDeferredTransitionIfNeeded:] + 386
12 UIKit 0x00000001066fef0e -[UINavigationController __viewWillLayoutSubviews] + 43
13 UIKit 0x0000000106849715 -[UILayoutContainerView layoutSubviews] + 202
14 UIKit 0x000000010661ca2b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 536
15 QuartzCore 0x00000001058caec2 -[CALayer layoutSublayers] + 146
16 QuartzCore 0x00000001058bf6d6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
17 QuartzCore 0x00000001058bf546 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
18 QuartzCore 0x000000010582b886 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
19 QuartzCore 0x000000010582ca3a _ZN2CA11Transaction6commitEv + 462
20 UIKit 0x0000000106599626 _UIApplicationHandleEventQueue + 2140
21 CoreFoundation 0x0000000105c31431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
22 CoreFoundation 0x0000000105c272fd __CFRunLoopDoSources0 + 269
23 CoreFoundation 0x0000000105c26934 __CFRunLoopRun + 868
24 CoreFoundation 0x0000000105c26366 CFRunLoopRunSpecific + 470
25 GraphicsServices 0x0000000108c02a3e GSEventRunModal + 161
26 UIKit 0x000000010659c900 UIApplicationMain + 1282
27 switter 0x0000000104834767 main + 135
28 libdyld.dylib 0x000000010883d145 start + 1
29 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Resources