"[MPTableViewAdPlacer numberOfSectionsInTableView:]: unrecognized selector sent to instance" crash

mopub
ios

#1

Hi.
I have a crash with MoPub v4.6.0 on iOS. It’s happening only when i use client’s defined ad positions in different sections.

Fatal Exception: NSInvalidArgumentException -[MPTableViewAdPlacer numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x1a26c6a0

Stacktrace looks like this:
Fatal Exception: NSInvalidArgumentException 0 CoreFoundation 0x22f6b98b __exceptionPreprocess 1 libobjc.A.dylib 0x22706e17 objc_exception_throw 2 CoreFoundation 0x22f71325 __methodDescriptionForSelector 3 CoreFoundation 0x22f6edf3 ___forwarding___ 4 CoreFoundation 0x22e9a2f8 _CF_forwarding_prep_0 5 UIKit 0x27955e91 -[UITableViewRowData _updateNumSections] 6 UIKit 0x275ba079 -[UITableViewRowData invalidateAllSections] 7 UIKit 0x276c8219 -[UITableView _endCellAnimationsWithContext:] 8 myApp 0x31ef0d -[MPTableViewAdPlacer adPlacer:didLoadAdAtIndexPath:] (MPTableViewAdPlacer.m:114) 9 myApp 0x31e0cb -[MPStreamAdPlacer fillAdsInConsideredRange] (MPStreamAdPlacer.m:514) 10 myApp 0x30d605 -[MPNativeAdSource adSourceQueueAdIsAvailable:] (MPNativeAdSource.m:80) 11 myApp 0x30dc5d __39-[MPNativeAdSourceQueue replenishCache]_block_invoke (MPNativeAdSourceQueue.m:127) 12 myApp 0x30bff3 __45-[MPNativeAdRequest assignCompletionHandler:]_block_invoke (MPNativeAdRequest.m:122) 13 myApp 0x30c87b -[MPNativeAdRequest completeAdRequestWithAdObject:error:] (MPNativeAdRequest.m:217) 14 myApp 0x30cc21 -[MPNativeAdRequest nativeCustomEvent:didLoadAd:] (MPNativeAdRequest.m:269) 15 myApp 0x307f89 __57-[MPMoPubNativeCustomEvent requestAdWithCustomEventInfo:]_block_invoke (MPMoPubNativeCustomEvent.m:41) 16 libdispatch.dylib 0x22ad9823 _dispatch_call_block_and_release 17 libdispatch.dylib 0x22ad980f _dispatch_client_callout 18 libdispatch.dylib 0x22ae7ba9 _dispatch_main_queue_callback_4CF$VARIANT$mp 19 CoreFoundation 0x22f2dbdd __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ 20 CoreFoundation 0x22f2c0d7 __CFRunLoopRun 21 CoreFoundation 0x22e7b2e9 CFRunLoopRunSpecific 22 CoreFoundation 0x22e7b0d5 CFRunLoopRunInMode 23 GraphicsServices 0x2446bac9 GSEventRunModal 24 UIKit 0x275400b9 UIApplicationMain 25 myApp 0x39f03 main (main.m:22) 26 libdispatch.dylib 0x22b23873 (Missing)

or

Fatal Exception: NSInternalInconsistencyException attempt to insert row 0 into section 0, but there are only 0 rows in section 0 after the update

Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x2541db8b __exceptionPreprocess 1 libobjc.A.dylib 0x24bdadff objc_exception_throw 2 CoreFoundation 0x2541da61 +[NSException raise:format:] 3 Foundation 0x25c0472b -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] 4 UIKit 0x29be1cf1 -[UITableView _endCellAnimationsWithContext:] 5 myApp 0x3edf0d -[MPTableViewAdPlacer adPlacer:didLoadAdAtIndexPath:] (MPTableViewAdPlacer.m:114) 6 myApp 0x3ed0cb -[MPStreamAdPlacer fillAdsInConsideredRange] (MPStreamAdPlacer.m:514) 7 myApp 0x3dc605 -[MPNativeAdSource adSourceQueueAdIsAvailable:] (MPNativeAdSource.m:80) 8 myApp 0x3dcc5d __39-[MPNativeAdSourceQueue replenishCache]_block_invoke (MPNativeAdSourceQueue.m:127) 9 myApp 0x3daff3 __45-[MPNativeAdRequest assignCompletionHandler:]_block_invoke (MPNativeAdRequest.m:122) 10 myApp 0x3db87b -[MPNativeAdRequest completeAdRequestWithAdObject:error:] (MPNativeAdRequest.m:217) 11 myApp 0x3dbc21 -[MPNativeAdRequest nativeCustomEvent:didLoadAd:] (MPNativeAdRequest.m:269) 12 myApp 0x3d6f89 __57-[MPMoPubNativeCustomEvent requestAdWithCustomEventInfo:]_block_invoke (MPMoPubNativeCustomEvent.m:41)

Anyone have any ideas why this is happening?


#2

Hi @TimofeyK,

Thanks for sharing your crash! Can you please fill out the following template and send it to support@mopub.com so we can escalate it for review?

  • Number of observed app crashes/frequency of the crashes: (e.g 5 crashes in 500 ad requests et al)
  • MoPub SDK version:
  • Partner SDK version, if involved:
  • Ad unit ID associated with the crash:
  • Steps to replicate the crash:
  • Crashlytics link and/or crash logs:

Thanks!