1
votes

Weird thing that I have spent about 4 hours debugging: Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named ADBannerView'

I used to have iAD and then removed it. Now I use Google AdMob.

I have macros set up to determine the free/paid version. On the free version that is supposed to show ads, everything is fine and it displays the AdMob ads.

In the paid version, which does not call any ads, I get this error: Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named ADBannerView'

The only thing I can think of is that I may have an old iAd Banner View somewhere, but I can't find it!

Any hints?

Also: Everything works fine on the simulator.

2
possible duplicate of iAd Banner is not workingBB9z

2 Answers

0
votes

Have you checked to make sure that there are no ADBannerViews in Interface Builder? The sort of error you are seeing says that the app is trying to create one somewhere.

0
votes

Educated guess:

are you using the UI State Preservation & Restoration API? If so return NO from application:shouldSaveApplicationState: to get rid of the current saved state.

Once that works you should implement some kind of restoration version checking to prevent crashes on your users devices.

If that doesn't work, or you are not using state restoration, try to delete the app from the device. If you deploy from Xcode files are only added, never removed. So it's possible that an old file references ADBannerView. Delete the app to get rid of such orphan files.

Edit: That link should take you to the "Encode version information along with the rest of your app’s state." section. It doesn't, but you will find a small info about version checking at the bottom of the page.