Bug 1535 - Linker crashing on MKMapKit RemoveAnnotations
Summary: Linker crashing on MKMapKit RemoveAnnotations
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 5.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2011-10-17 14:31 UTC by Ian
Modified: 2011-11-10 14:33 UTC (History)
2 users (show)

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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Ian 2011-10-17 14:31:40 UTC
I upgraded to iOS 5.0 with the newest MonoTouch/MonoDevelop.

When I compile an app that it set to the 3.2 SDK in properties, I get this Linker error:

Compiling to native code
/Developer/MonoTouch/usr/bin/mtouch -v --nomanifest --nosign -dev "/Users/vink/Dropbox/Dev/iOS/IPAD/BibleAndRef/bin/iPhone/Release/BibleAndRef.app" -r "/Users/vink/Dropbox/Dev/iOS/Common/bin/iPhone/Release/Common.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.Linq.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Data.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Web.Services.dll" -linksdkonly -sdk "5.0" -targetver "3.2" "/Users/vink/Dropbox/Dev/iOS/IPAD/BibleAndRef/bin/iPhone/Release/BibleAndRef.exe"
Framework is: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk
Copied /Users/vink/Dropbox/Dev/iOS/IPAD/BibleAndRef/bin/iPhone/Release/BibleAndRef.exe to /Users/vink/Dropbox/Dev/iOS/IPAD/BibleAndRef/bin/iPhone/Release/BibleAndRef.app/BibleAndRef.exe
Copied /Users/vink/Dropbox/Dev/iOS/IPAD/BibleAndRef/bin/iPhone/Release/MonoTouch.Dialog.dll to /Users/vink/Dropbox/Dev/iOS/IPAD/BibleAndRef/bin/iPhone/Release/BibleAndRef.app/MonoTouch.Dialog.dll
Linking SDK only for assembly /Users/vink/Dropbox/Dev/iOS/IPAD/BibleAndRef/bin/iPhone/Release/BibleAndRef.exe into /Users/vink/Dropbox/Dev/iOS/IPAD/BibleAndRef/bin/iPhone/Release/BibleAndRef.app
Could not link assemblies: Mono.Linker.ResolutionException: Can not resolve reference: System.Void MonoTouch.MapKit.MKMapView::RemoveAnnotations(MonoTouch.MapKit.MKAnnotation[])
  at Mono.Linker.Steps.MarkStep.ResolveMethodDefinition (Mono.Cecil.MethodReference method) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.Process () [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0 
  at MonoTouch.Tuner.Linker.Run (Mono.Linker.Pipeline pipeline, Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0 
mtouch exited with code 1
Comment 1 Sebastien Pouliot 2011-10-18 08:40:25 UTC
I cannot duplicate this issue. With, or without, setting the targetver to 3.2. Does it work when using the default target version ?

Also could you attach the full build log ? (i.e. the smcs part before mtouch is called)

I see that /Users/vink/Dropbox/Dev/iOS/Common/bin/iPhone/Release/Common.dll is referenced but is not copied before the linker is executed. OTOH MonoTouch.Dialog.dll is not referenced (directly) but is being copied to the .app directory.

note: make sure to do a "clean" solution before (in case everything was not rebuilt since the update to MonoTouch 5)
Comment 2 Sebastien Pouliot 2011-11-10 14:14:57 UTC
Are you still able to reproduce this error ? if so can you supply me the build logs (see previous comment) so we can ensure this gets fixed in future releases ?
Comment 3 Ian 2011-11-10 14:18:12 UTC
After upgrading to MT 5 and MD 2.8 the problem went away
Comment 4 Sebastien Pouliot 2011-11-10 14:33:49 UTC
ok, closing (re-open if you ever hit the same issue again). thanks