Crash when native adverts are added to TableView




I have MoPub integrated into my app, and have recently started to use

I have an intermittent crash reported on Crashlytics that I’m unable to reproduce, the error is a classic UITableView / Datasource error:

Fatal Exception: NSInternalInconsistencyException
Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update....

Our datasource is a Realm model object, and I’m using an MPTableViewAdPlacer and all of the relevant mp_x methods to manipulate the TableView.

The crash appears to originate from when we call MPTableViewAdPlacer.loadAdsForAppAdUnitID(), and an ad is added or removed to the TableView via MPTableViewAdPlacer.didLoadAdAtIndexPath & MPTableViewAdPlacer.didRemoveAdsAtIndexPaths.

I can only assume that our datasource has changed its values while [self.tableView mp_beginUpdates]
[self.tableView mp_endUpdates] is being executed.

Do you have any advise on how I can try to reproduce this issue, or what types of transactions would cause this?



I have the same problem, you have managed to find a solution?


Hi @DesS & @TimofeyK,

Thanks for sharing these details with us! Please reach out to with the following details and we would be glad to give this a deeper look. Make sure to include the link to this forum in your email to the Support Team.

  1. MoPub SDK version
  2. Steps to reproduce the crash
  3. Sample build of your app



I have the same problem, someone know how to fix this?


Realm updates cause the same kind of crash in collection view with native ads here.
Datasource gets updated while the adplacer trying to insert or delete ad cells.
Any updates on the issue?


Could you find a solution?