Bug 56659 - MTOUCH: Error MT2001: Could not link assemblies. Reason: Object reference not set to an instance of an object (MT2001)
Summary: MTOUCH: Error MT2001: Could not link assemblies. Reason: Object reference not...
Status: RESOLVED DUPLICATE of bug 56296
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild ()
Version: XI 10.10 (d15-2)
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-05-19 06:48 UTC by Gabor Nemeth
Modified: 2017-05-30 13:16 UTC (History)
3 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 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 Gabor Nemeth 2017-05-19 06:48:28 UTC
Using Xamarin.iOS 10.10 I get the following error when building one of my apps.
The issue presents itself only when linker behavior is set to "Link Framework SDKs only".

I could not make a simple repro case, other apps build fine. This is a private app, I currently cannot upload the source here.
The relevant section of build log - diagnostic level:
(Created this bug report, because did not find any other MT2001 issue with a stacktrace similar to this).

		Linking /Users/gabor/Projects/bryan_Brightwood/Source/App/Brightwood/Store Apps/Brightwood.iOS/obj/iPhoneSimulator/Debug/device-builds/ipad6.8-10.3/mtouch-cache/Link/Brightwood.iOS.exe into /Users/gabor/Projects/bryan_Brightwood/Source/App/Brightwood/Store Apps/Brightwood.iOS/obj/iPhoneSimulator/Debug/device-builds/ipad6.8-10.3/mtouch-cache/PreBuild using mode 'SDKOnly'
MTOUCH: error MT2001: Could not link assemblies. Reason: Object reference not set to an instance of an object
		--- inner exception
		System.NullReferenceException: Object reference not set to an instance of an object
		  at Mono.Linker.Steps.ResolveFromAssemblyStep.ProcessLibrary (Mono.Linker.LinkContext context, Mono.Cecil.AssemblyDefinition assembly) [0x000d9] in /Users/builder/data/lanes/4691/3e5ac5ff/source/xamarin-macios/external/linker/linker/Mono.Linker.Steps/ResolveFromAssemblyStep.cs:99 
		  at Mono.Tuner.CustomizeActions.ProcessUserAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x00008] in /Users/builder/data/lanes/4691/3e5ac5ff/source/xamarin-macios/external/linker/tuner/Mono.Tuner/CustomizeActions.cs:90 
		  at Mono.Tuner.CustomizeActions.ProcessAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x0003f] in /Users/builder/data/lanes/4691/3e5ac5ff/source/xamarin-macios/external/linker/tuner/Mono.Tuner/CustomizeActions.cs:33 
		  at MonoTouch.Tuner.CustomizeIOSActions.ProcessAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x00021] in /Users/builder/data/lanes/4691/3e5ac5ff/source/xamarin-macios/tools/mtouch/Tuning.cs:274 
		  at Mono.Linker.Steps.BaseStep.Process (Mono.Linker.LinkContext context) [0x00033] in /Users/builder/data/lanes/4691/3e5ac5ff/source/xamarin-macios/external/linker/linker/Mono.Linker.Steps/BaseStep.cs:55 
		  at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00027] in /Users/builder/data/lanes/4691/3e5ac5ff/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/3e5ac5ff/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/3e5ac5ff/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/3e5ac5ff/source/xamarin-macios/tools/mtouch/Target.cs:551 
		  at Xamarin.Bundler.Target.ManagedLink () [0x005ce] in /Users/builder/data/lanes/4691/3e5ac5ff/source/xamarin-macios/tools/mtouch/Target.cs:674 
		  at Xamarin.Bundler.Target.ProcessAssemblies () [0x000b4] in /Users/builder/data/lanes/4691/3e5ac5ff/source/xamarin-macios/tools/mtouch/Target.cs:854 
		  at Xamarin.Bundler.Application.ProcessAssemblies () [0x00036] in /Users/builder/data/lanes/4691/3e5ac5ff/source/xamarin-macios/tools/mtouch/Application.cs:1355 
		  at Xamarin.Bundler.Application.BuildManaged () [0x00002] in /Users/builder/data/lanes/4691/3e5ac5ff/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/3e5ac5ff/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/3e5ac5ff/source/xamarin-macios/tools/mtouch/Application.cs:761 
		  at Xamarin.Bundler.Driver.Main2 (System.String[] args) [0x0048b] in /Users/builder/data/lanes/4691/3e5ac5ff/source/xamarin-macios/tools/mtouch/mtouch.cs:1495 
		  at Xamarin.Bundler.Driver.Main (System.String[] args) [0x0000f] in /Users/builder/data/lanes/4691/3e5ac5ff/source/xamarin-macios/tools/mtouch/mtouch.cs:1006 
		Tool /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch execution finished.
	Task "MTouch" execution -- FAILED
	Done building target "_CompileToNative" in project "/Users/gabor/Projects/bryan_Brightwood/Source/App/Brightwood/Store Apps/Brightwood.iOS/Brightwood.iOS.csproj".-- FAILED
Comment 1 Vincent Dondain [MSFT] 2017-05-19 11:26:35 UTC
This is an issue with Cecil with regard to portable pdb file.

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