Bug 22963 - error MT2001: Could not link assemblies. Reason: Object reference not set to an instance of an object
Summary: error MT2001: Could not link assemblies. Reason: Object reference not set to ...
Status: RESOLVED DUPLICATE of bug 22893
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 8.0.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-09-13 02:51 UTC by Fabien Molinet
Modified: 2014-09-19 13:12 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 22893

Comment 1 Fabien Molinet 2014-09-13 03:14:35 UTC
This happens when building for the real device and using link SDK assemblies only.

If I use don't link assemblies then we need to pass the argument  --registrar:legacy  not sure why, it complains about new iOS8 methods even though I compile & target SDK 7.1.
With don't link it works. It is able to generate the IPA file.

This is not a workaround though. We need to generate the app in Adhoc will link SDK assemblies only.
Comment 2 Sebastien Pouliot 2014-09-13 11:27:17 UTC
2 projects complains when loading into XS

- Hager.e2go.UnitTest
- Hager.e2go.Core.BusinessCardReader


They might not be important (at least the tests) but I cannot build the main Harger.e2go.Touch project either:

Failed to execute custom command '/Users/poupou/Downloads/Archive-2/mono-t4': ApplicationName='/Users/poupou/Downloads/Archive-2/mono-t4', CommandLine='/Users/poupou/Downloads/Archive-2/Hager.e2go.Core/Infrastructure/LocalizationKey.cs /Users/poupou/Downloads/Archive-2/Hager.e2go.Core/Infrastructure/LocalizationKey.tt', CurrentDirectory='/Users/poupou/Downloads/Archive-2/Hager.e2go.Core', Native error= Cannot find the specified file
Build canceled.


I'll try to workaround them (but that might influence results, so I'd rather have the closest thing possible).

Also can you tell us the other software versions* being used ?


* The easiest way to get exact version information is to use the "Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details" button and copy/paste the version informations (you can use the "Copy Information" button).
Comment 3 Sebastien Pouliot 2014-09-13 11:37:47 UTC
There are also several packages referenced that (for some reason) are not downloaded automatically. Again without the same version of the assemblies the results might differ.

Assembly 'Cirrious.CrossCore' not found. Make sure that the assembly exists in disk. If the reference is required to build the project you may get compilation errors.
Assembly 'Cirrious.MvvmCross' not found. Make sure that the assembly exists in disk. If the reference is required to build the project you may get compilation errors.
Assembly 'Cirrious.MvvmCross.Plugins.PhoneCall' not found. Make sure that the assembly exists in disk. If the reference is required to build the project you may get compilation errors.
Assembly 'Cirrious.MvvmCross.Plugins.Messenger' not found. Make sure that the assembly exists in disk. If the reference is required to build the project you may get compilation errors.
Assembly 'ModernHttpClient' not found. Make sure that the assembly exists in disk. If the reference is required to build the project you may get compilation errors.


I kind of suspect an `mcs` (mono C# compiler) bug that was fixed this week (and an updated 3.8.x should be out soon). Can you also provide a full build log where the "additional mtouch arguments" contains "-v -v -v -v" ? so we have maximum verbosity (that should tell me if the issue is identical, or not).

Thanks!
Comment 7 Fabien Molinet 2014-09-13 13:29:32 UTC
Please note that I recently switched to Beta channel but the issue was similar in Stable channel.
Comment 8 Sebastien Pouliot 2014-09-13 13:49:41 UTC
Thanks for the extra details! This confirms it's the `mcs` (attribute encoding) bug in mono 3.8.

A newer mono 3.8.x will be available next week and will solve this issue. In the mean time you can either avoid linking (if you're not releasing) or switch back to mono 3.6.

*** This bug has been marked as a duplicate of bug 22893 ***
Comment 9 Fabien Molinet 2014-09-13 13:53:04 UTC
Many thanks Sebastien.
Do you know how I can switch back to mono 3.6? I need to release a corporate app very soon.
Comment 10 Fabien Molinet 2014-09-13 18:16:07 UTC
I downloaded Mono 3.6 from http://download.mono-project.com/archive/3.6.0/macos-10-x86/MonoFramework-MDK-3.6.0.macos10.xamarin.x86.pkg

And I was still getting the same issue. Then I reminded what I did: I also got the latest Nuget package of ModernHttpClient (ie: 2.1.0). Reverting back to 2.01 + Mono 3.6 fixed my issue.
Comment 11 Fabien Molinet 2014-09-19 13:03:17 UTC
When will this be available in Beta or Alpha channel?
This is really critical since we need to rebuild an app due to iOS8 but we can't due to this bug...

Many thanks
Comment 12 Sebastien Pouliot 2014-09-19 13:12:22 UTC
@Fabien I thought it already was, still you can use Mono 3.6 with XI 8.0 (and 3.10/8.2 alphas should be out soon).

@PJ was the 3.8.x-fixed version released ?

ref: https://bugzilla.xamarin.com/show_bug.cgi?id=22893#c17