ilap / MaterialComponentsXamarin

Xamarin.iOS bindigs for Material Components for iOS (MDC-iOS).
Apache License 2.0
27 stars 9 forks source link

iOS builds fail in Release/Adhoc mode - Cannot register two managed types with the same native name ('MDCBasicColorScheme') #1

Open alexsorokoletov opened 6 years ago

alexsorokoletov commented 6 years ago

error MT4118: Cannot register two managed types ('MaterialComponents.MaterialBottomNavigation.MDCBasicColorScheme, MaterialComponents' and 'MaterialComponents.MaterialThemes.MDCBasicColorScheme, MaterialComponents') with the same native name ('MDCBasicColorScheme')

The package is installed through NuGet Xamarin.iOS.MaterialComponents v 39.0.0

MTOUCH : error MT4116: Could not register the assembly 'MaterialComponents': error MT4118: Cannot register two managed types ('MaterialComponents.MaterialBottomNavigation.MDCBasicColorScheme, MaterialComponents' and 'MaterialComponents.MaterialThemes.MDCBasicColorScheme, MaterialComponents') with the same native name ('MDCBasicColorScheme'). [/Users/vsts/agent/2.133.3/work/1/s/MyApp/MyApp.iOS.csproj]

andreiagmu commented 6 years ago

I'm having the same error while trying to build the ShrineXamarin example, in "Debug | iPhoneSimulator" mode.

This error is possibly the cause of another problem I'm having in my own Xamarin.iOS project: After adding the NuGet Xamarin.iOS.MaterialComponents v 39.0.0, if I try to open any .xib/.storyboard file by using the option "Open With -> Xcode Interface Builder", then Xcode won't open, and Visual Studio displays the message "Error updating Objective-C type information". My .xib/.storyboard files work correctly if I remove the MaterialComponents NuGet from the project. This behaviour also happens when I try to open the .storyboard files from ShrineXamarin example (using the option "Open With -> Xcode Interface Builder").

2018-06-01 16:33:34.563 ShrineXamarin[857:11755] Could not register the assembly 'MaterialComponents': ObjCRuntime.RuntimeException: Cannot register two managed types ('MaterialComponents.MaterialBottomNavigation.MDCBasicColorScheme, MaterialComponents, Version=35.0.0.29768, Culture=neutral, PublicKeyToken=null' and 'MaterialComponents.MaterialThemes.MDCBasicColorScheme, MaterialComponents, Version=35.0.0.29768, Culture=neutral, PublicKeyToken=null') with the same native name ('MDCBasicColorScheme'). at Registrar.Registrar.RegisterTypeUnsafe (System.Type type, System.Collections.Generic.List``1[System.Exception]& exceptions) [0x002df] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:1933 at Registrar.Registrar.RegisterAssembly (System.Reflection.Assembly assembly) [0x00076] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2381

andreiagmu commented 6 years ago

I just saw jdbrock's fork, I think this commit solves this issue.

I guess someone (is @ilap active?) would need to update the NuGet package, and accept jdbrock's pending PR.

For now, in my project I downgraded the MaterialComponents NuGet to v35.2.0, and it seems to work nicely.

ilap commented 6 years ago

Hi,

I am not really active on this project anymore, so if somebody is interested in taking over the project then I can send a contribution invitation or even transfer ownership.

Cheers,

Pal