3

A very simple one-page app that includes an ADBannerView crashes on the device whilst running fine in the simulator.

The crash is at the point of constructing the main view controller from the XIB.

The error is as follows:

"cannot decode object of class (ADBannerView)"

I'm wondering if there is an additional MonoTouch assembly I need to include?

The device is running 4.3.2 and the 4.3 SDK.

EDIT: ah, got it - I have to add the following flags (regardless of targeted OS version)

 -gcc_flags "-weak_framework iAd"
vlad259
  • 1,236
  • 10
  • 24
  • Don't know what the protocol is for this - do I delete the question? Flag it in some other way? – vlad259 Apr 28 '11 at 14:27
  • Answer your own question, then after 24 hours you can accept that answer as the correct one. This allows others to see and learn from what you did. – Jason Apr 28 '11 at 14:38

1 Answers1

3

Ah, got it - I have to add the following flags (regardless of targeted OS version)

 -gcc_flags "-weak_framework iAd"

This is all in MonoTouch 3.2.6 BTW. I haven't tried it in 4.x yet, but when I do I will update this issue.

vlad259
  • 1,236
  • 10
  • 24
  • 1
    For everyone else's benefit, remember to add it for BOTH your Debug and Release configurations, or else you'll be wondering why it works in the debugger but not on a device in release mode :) – Matt Dotson Apr 20 '12 at 02:58
  • Update: this still fixes the issue in MT 6.0.4. The exception I get when I forget to put it in is NSInvalidUnarchiveOperationException, reason 'Could not instantiate class named ADBannerView' – vlad259 Oct 30 '12 at 17:59