Bug 60252 - Error MT4116: Could not register the assembly 'Xamarin.Auth.iOS': error MT4118: Cannot register two managed types
Summary: Error MT4116: Could not register the assembly 'Xamarin.Auth.iOS': error MT411...
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: Production (addons.xamarin.com)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Miljenko Cvjetko Mel
Depends on:
Reported: 2017-10-18 11:08 UTC by elshan.siradjov
Modified: 2017-12-05 20:56 UTC (History)
3 users (show)

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

Build Log of App which doesn't run on the iOS device because of ProgressLabel conflict (2.93 MB, text/plain)
2017-10-31 13:38 UTC, elshan.siradjov

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 elshan.siradjov 2017-10-18 11:08:20 UTC
Error MT4116: Could not register the assembly 'Xamarin.Auth.iOS': error MT4118: Cannot register two managed types ('Xamarin.Controls.ProgressLabel, Xamarin.Auth.iOS' and 'Xamarin.Controls.ProgressLabel, Xamarin.Auth') with the same native name ('Xamarin_Controls_ProgressLabel'). (MT4116)

The ProgressLabel class seems to be defined in Xamarin.Auth.iOS and Xamarin.Auth twice.
Comment 1 John Miller [MSFT] 2017-10-18 13:28:00 UTC

*** This bug has been marked as a duplicate of bug 57915 ***
Comment 2 elshan.siradjov 2017-10-19 08:57:27 UTC
@John Miller there is a difference here between Bug 57915 and this bug. This one does not have anything to do with Microsoft.Azure.Mobile.Client.dll.
Comment 3 John Miller [MSFT] 2017-10-19 12:37:01 UTC
Hi Elshan,

Could you include a diagnostic build log so I can see what other assemblies might be conflicting? 

To get full build logs just set the log verbosity to diagnostic at the following locations:
- On Visual Studio for Mac: Preferences > Projects > Build
- On Visual Studio for Windows: Tools > Options > Projects and Solutions > Build and Run

On Visual Studio Windows you also want to add `-v -v -v -v` to the mtouch additional arguments by right-clicking the project in the solution explorer and selecting `Properties`.
Note: this is done automatically on Visual Studio for Mac when the log verbosity is set to diagnostic.

Then, collect the Output and paste into a .txt file and attach here. Thanks!
Comment 4 elshan.siradjov 2017-10-31 13:38:55 UTC
Created attachment 25516 [details]
Build Log of App which doesn't run on the iOS device because of ProgressLabel conflict
Comment 5 John Miller [MSFT] 2017-10-31 14:05:30 UTC
Thanks elshan,

Where is Xamarin.Auth.iOS comming from? When I add Xamarin.Auth from NuGet, I don't see a library used with this reference. Is there an old package or component still added to the iOS project that can be removed? 

Delete the reference in the iOS project to the Xamarin.Auth.iOS assembly and verify that the issue is resolved.
Comment 6 elshan.siradjov 2017-10-31 15:07:37 UTC
Hi John,

I deleted the reference as you said and also removed the Xamarin.Auth.iOS.dlls from the project. However, when I build the app for the device I get a new error:

MTOUCH: Error MT2002: Failed to resolve "Xamarin.Auth.Account" reference from "Xamarin.Auth.iOS, Version=, Culture=neutral, PublicKeyToken=null" (MT2002)
Comment 7 John Miller [MSFT] 2017-10-31 16:30:04 UTC
Hi Elshan,

Could you create a new project and add the same DLLs/Package to it to reproduce the original build error, then attach it here so I can take a look? 

I am not sure which libraries you are using and if they are up-to-date, etc. I am not able to find version of these libraries. 

Comment 8 elshan.siradjov 2017-12-05 20:53:48 UTC
Thank you for your help John Miller.

Through further investigation I found other useless references which were causing more errors. After tracking down unneeded files and removing them one by one from the project I finally got it work.
The main reason was that I was given this project which had been using legacy libraries/dlls which don't exist anymore.
Again thanks for your effort!