Bug 57580 - MTOUCH : error MT2001: Could not link assemblies. Reason: Value cannot be null. Parameter name: instruction
Summary: MTOUCH : error MT2001: Could not link assemblies. Reason: Value cannot be nu...
Status: RESOLVED DUPLICATE of bug 56296
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll (show other bugs)
Version: XI 10.0 (iOS10)
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-06-18 05:52 UTC by Rendy Del Rosario
Modified: 2017-06-19 14:10 UTC (History)
4 users (show)

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


Attachments
Full build log (629.61 KB, text/plain)
2017-06-18 06:01 UTC, Rendy Del Rosario
Details


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:
Status:
RESOLVED DUPLICATE of bug 56296

Description Rendy Del Rosario 2017-06-18 05:52:34 UTC
MTOUCH : error MT2001: Could not link assemblies.
    	Method: `System.Void MyProject.ViewModels.HomePageViewModel::OnNavigatedFrom(Prism.Navigation.NavigationParameters)`
    	Assembly: `MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null`
    Reason: Value cannot be null.
    Parameter name: instruction
    --- inner exception
    System.ArgumentNullException: Value cannot be null.
    Parameter name: instruction
      at Mono.Cecil.Cil.InstructionOffset..ctor (Mono.Cecil.Cil.Instruction instruction) [0x00003] in <4fabf1217b0249ea867af084ea2f11eb>:0 
      at Mono.Cecil.Cil.CodeReader.ReadAsyncMethodBody (Mono.Cecil.Cil.AsyncMethodBodyDebugInformation async_method) [0x0005c] in <4fabf1217b0249ea867af084ea2f11eb>:0 
      at Mono.Cecil.Cil.CodeReader.ReadCustomDebugInformations (Mono.Cecil.MethodDefinition method) [0x00032] in <4fabf1217b0249ea867af084ea2f11eb>:0 
      at Mono.Cecil.Cil.CodeReader.ReadDebugInfo () [0x0004d] in <4fabf1217b0249ea867af084ea2f11eb>:0 
      at Mono.Cecil.Cil.CodeReader.ReadMethodBody () [0x00091] in <4fabf1217b0249ea867af084ea2f11eb>:0 
      at Mono.Cecil.Cil.CodeReader.ReadMethodBody (Mono.Cecil.MethodDefinition method) [0x00014] in <4fabf1217b0249ea867af084ea2f11eb>:0 
      at Mono.Cecil.MetadataReader.ReadMethodBody (Mono.Cecil.MethodDefinition method) [0x00000] in <4fabf1217b0249ea867af084ea2f11eb>:0 
      at Mono.Cecil.MethodDefinition+<>c.<get_Body>b__41_0 (Mono.Cecil.MethodDefinition method, Mono.Cecil.MetadataReader reader) [0x00000] in <4fabf1217b0249ea867af084ea2f11eb>:0 
      at Mono.Cecil.ModuleDefinition.Read[TItem,TRet] (TRet& variable, TItem item, System.Func`3[T1,T2,TResult] read) [0x00040] in <4fabf1217b0249ea867af084ea2f11eb>:0 
      at Mono.Cecil.MethodDefinition.get_Body () [0x0002c] in <4fabf1217b0249ea867af084ea2f11eb>:0 
      at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00191] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/external/linker/linker/Mono.Linker.Steps/MarkStep.cs:1046 
      at Xamarin.Linker.Steps.CoreMarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00060] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/tools/linker/CoreMarkStep.cs:171 
      at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00026] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/external/linker/linker/Mono.Linker.Steps/MarkStep.cs:150 
      at Mono.Linker.Steps.MarkStep.Process () [0x0001e] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/external/linker/linker/Mono.Linker.Steps/MarkStep.cs:115 
      at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x0000f] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/external/linker/linker/Mono.Linker.Steps/MarkStep.cs:60 
      at Xamarin.Linker.Steps.MobileMarkStep.Process (Mono.Linker.LinkContext context) [0x00003] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/tools/linker/MobileMarkStep.cs:33 
      at Xamarin.Linker.Steps.CoreMarkStep.Process (Mono.Linker.LinkContext context) [0x00018] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/tools/linker/CoreMarkStep.cs:26 
      at MonoTouch.Tuner.MonoTouchMarkStep.Process (Mono.Linker.LinkContext context) [0x0001e] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/tools/linker/MonoTouch.Tuner/MonoTouchMarkStep.cs:36 
      at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00027] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/external/linker/linker/Mono.Linker/Pipeline.cs:118 
      at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, MonoTouch.Tuner.MonoTouchLinkContext& context, System.Collections.Generic.List`1[Mono.Cecil.AssemblyDefinition]& assemblies) [0x000dd] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/tools/mtouch/Tuning.cs:82 
    ---
      at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, MonoTouch.Tuner.MonoTouchLinkContext& context, System.Collections.Generic.List`1[Mono.Cecil.AssemblyDefinition]& assemblies) [0x002a9] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/tools/mtouch/Tuning.cs:111 
      at Xamarin.Bundler.Target.LinkAssemblies (System.Collections.Generic.List`1[Mono.Cecil.AssemblyDefinition]& assemblies, System.String output_dir, System.Collections.Generic.IEnumerable`1[T] sharedCodeTargets) [0x00257] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/tools/mtouch/Target.cs:551 
      at Xamarin.Bundler.Target.ManagedLink () [0x005ce] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/tools/mtouch/Target.cs:674 
      at Xamarin.Bundler.Target.ProcessAssemblies () [0x000b4] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/tools/mtouch/Target.cs:854 
      at Xamarin.Bundler.Application.ProcessAssemblies () [0x00036] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/tools/mtouch/Application.cs:1355 
      at Xamarin.Bundler.Application.BuildManaged () [0x00002] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/tools/mtouch/Application.cs:809 
      at Xamarin.Bundler.Application.<BuildAll>m__7 (Xamarin.Bundler.Application v) [0x00001] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/tools/mtouch/Application.cs:761 
      at System.Collections.Generic.List`1[T].ForEach (System.Action`1[T] action) [0x00024] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/collections/generic/list.cs:564 
      at Xamarin.Bundler.Application.BuildAll () [0x00067] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/tools/mtouch/Application.cs:761 
      at Xamarin.Bundler.Driver.Main2 (System.String[] args) [0x0048b] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/tools/mtouch/mtouch.cs:1495 
      at Xamarin.Bundler.Driver.Main (System.String[] args) [0x0000f] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/tools/mtouch/mtouch.cs:1006 
Done building target "_CompileToNative" in project "MyProject.iOS.csproj" -- FAILED.

Done building project "MyProject.iOS.csproj" -- FAILED.

=======================


=== Visual Studio Community 2017 for Mac ===

Version 7.0.1 (build 24)
Installation UUID: 521a5db8-3705-4aa8-8158-e94ef68c8810
Runtime:
	Mono 5.0.1.1 (2017-02/5077205) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 500010001

=== NuGet ===

Version: 4.0.0.2323

=== .NET Core ===

Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.4
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 7.3.1.2 (Visual Studio Community)
Android SDK: /Users/Chard/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.5
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Apple Developer Tools ===

Xcode 8.2.1 (11766.1)
Build 8C1002

=== Xamarin.Mac ===

Version: 3.4.0.36 (Visual Studio Community)

=== Xamarin.iOS ===

Version: 10.10.0.36 (Visual Studio Community)
Hash: d2270eec
Branch: d15-2
Build date: 2017-05-22 16:30:53-0400

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Build Information ===

Release ID: 700010024
Git revision: 7ab1ca2ced6f584e56b7a0d4d321d00775cd95c9
Build date: 2017-05-19 05:44:51-04
Xamarin addins: 08d17158f3365beee5e60f67999e607cce4b3f93
Build lane: monodevelop-lion-d15-2

=== Operating System ===

Mac OS X 10.12.5
Darwin 16.6.0 Darwin Kernel Version 16.6.0
    Fri Apr 14 16:21:16 PDT 2017
    root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64
Comment 1 Rendy Del Rosario 2017-06-18 06:01:10 UTC
Created attachment 22961 [details]
Full build log
Comment 2 Rendy Del Rosario 2017-06-18 06:02:38 UTC
Only Happens when building in a Release configuration. In this case was AppStore|iPhone
Comment 3 Rendy Del Rosario 2017-06-18 06:07:19 UTC
=== Visual Studio Community 2017 for Mac ===

Version 7.0.1 (build 24)
Installation UUID: 521a5db8-3705-4aa8-8158-e94ef68c8810
Runtime:
	Mono 5.0.1.1 (2017-02/5077205) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 500010001

=== NuGet ===

Version: 4.0.0.2323

=== .NET Core ===

Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.4
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 7.3.1.2 (Visual Studio Community)
Android SDK: /Users/Chard/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.5
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Apple Developer Tools ===

Xcode 8.2.1 (11766.1)
Build 8C1002

=== Xamarin.Mac ===

Version: 3.4.0.36 (Visual Studio Community)

=== Xamarin.iOS ===

Version: 10.10.0.36 (Visual Studio Community)
Hash: d2270eec
Branch: d15-2
Build date: 2017-05-22 16:30:53-0400

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Build Information ===

Release ID: 700010024
Git revision: 7ab1ca2ced6f584e56b7a0d4d321d00775cd95c9
Build date: 2017-05-19 05:44:51-04
Xamarin addins: 08d17158f3365beee5e60f67999e607cce4b3f93
Build lane: monodevelop-lion-d15-2

=== Operating System ===

Mac OS X 10.12.5
Darwin 16.6.0 Darwin Kernel Version 16.6.0
    Fri Apr 14 16:21:16 PDT 2017
    root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64
Comment 4 Jon Dick 2017-06-18 18:29:28 UTC
I'm hitting this too.

If I choose mono 4.8 to build it's fine, Mono 5.x is not.  I presume this has to do with pdb vs mdb and Cecil being involved here.

I might add that I'm using Fody 2.1.0 and Fody.PropertyChanged 2.1.2.
Comment 5 Alex Soto [MSFT] 2017-06-19 14:10:32 UTC
build log shows this is a dupe of bug #56296 please use Xamarin.Forms 2.3.4.247 or greater

*** This bug has been marked as a duplicate of bug 56296 ***