2014-10-05 47 views
0

使用Xamarin XS v5.5,AutoMapper v3.2.1, 我在發佈版本(未在調試中)中得到此運行時錯誤:
This type is not supported on this platform INullableConverterFactory爲什麼我在發佈版本中出現此錯誤:此平臺不支持此類型INullableConverterFactory

[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: 
    An exception was thrown by the type initializer for AutoMapper.Mappers.MapperRegistry ---> 
    System.TypeInitializationException: 
    An exception was thrown by the type initializer for AutoMapper.Mappers.EnumMapper ---> 
    System.PlatformNotSupportedException: This type is not supported on this platform INullableConverterFactory 
[mono-rt] at AutoMapper.Internal.PlatformAdapter.Resolve[INullableConverterFactory] (Boolean throwIfNotFound) [0x00000] in <filename unknown>:0 
[mono-rt] at AutoMapper.Mappers.EnumMapper..cctor() [0x00000] in <filename unknown>:0 
[mono-rt] --- End of inner exception stack trace --- 
[mono-rt] at AutoMapper.Mappers.MapperRegistry..cctor() [0x00000] in <filename unknown>:0 
[mono-rt] --- End of inner exception stack trace --- 
[mono-rt] at AutoMapper.Mapper.Reset() [0x00000] in <filename unknown>:0 
[mono-rt] at AutoMapper.Mapper.Initialize (System.Action`1 action) [0x00000] in <filename unknown>:0 
[mono-rt] at MyApp.Android.MainActivity.ConfigMapper() [0x00000] in <filename unknown>:0 
[mono-rt] at MyApp.Android.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x00000] in <filename unknown>:0 
[mono-rt] at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState) [0x00000] in <filename unknown>:0 
[mono-rt] at (wrapper dynamic-method) object:3cc570cf-1f33-4513-b6e4-0e910820d0ba (intptr,intptr,intptr) 

還有什麼問題呢?

+0

你確定所有的程序集都被複制了嗎?基於[this]猜測(https://github.com/AutoMapper/AutoMapper/issues/370#ref-issue-12520648) – rene 2014-10-05 18:19:47

+0

有沒有想過這個呢? ive繼承了一個xamarin項目,當我試圖發佈一個新版本即時通訊獲得類似的錯誤 – InitLipton 2015-06-19 15:42:38

+0

@InitLipton,沒有抱歉,我不記得原因是什麼。很可能是以後版本中已修復的XS Studio錯誤。自從我發佈這個問題以來沒有經歷過。 – 2015-06-20 17:11:41

回答

0

這是最有可能的連接器去除的AutoMapper組件類型..

通常釋放模式有鏈接設置爲SDK組件或全部組件,其中如DEBUG沒有做任何鏈接在這裏

檢查如何修改什麼聯繫 https://developer.xamarin.com/guides/cross-platform/advanced/custom_linking/

我有同樣的異常,並在固定加入這個傢伙就

<assembly fullname="AutoMapper"> 
    <type fullname="*INullableConverterFactory*" /> 
    <type fullname="*MappingExpression*" /> 
</assembly> 
相關問題