Bug 3117 - exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named MKMapView' - solution wire it up to an instance variable
Summary: exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instanti...
Status: CONFIRMED
Alias: None
Product: iOS
Classification: Xamarin
Component: General (show other bugs)
Version: 5.2
Hardware: Macintosh Mac OS
: Normal enhancement
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
URL:
: 13561 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-27 14:27 UTC by Gerry
Modified: 2016-02-08 18:00 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 3117 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Gerry 2012-01-27 14:27:00 UTC
If you have a Mapview control to a view but do not wire up an instance variable to it you'll get a runtime crash on the device as shown:

exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named MKMapView'

The workaround is to just wire up an instance variable to the control in the NIB.  I guess at that point mono touch realizes it needs to link in the map kit library.

I realize most people will want to hook up the variable but when you are initially laying out your screen you may not do this and then get the above crash and waste a lot of time tracking it down.
Comment 1 Miguel de Icaza [MSFT] 2012-02-01 16:32:31 UTC
Hello Gerry,

This is a good suggestion;   We will have to update our linker to reference frameworks that are listed on XIB files, even if they are not referenced in the code.
Comment 2 David Tavárez 2013-06-21 17:16:40 UTC
MMmmm... Still with the same problem. Is this closed?

(iPhone 3GS with iOS 6.03)
Comment 3 Rolf Bjarne Kvinge [MSFT] 2013-07-31 12:30:34 UTC
*** Bug 13561 has been marked as a duplicate of this bug. ***