2016-03-18 50 views
0

在iOS應用發送電子郵件我工作的一所學校項目,我試圖登錄是從一個遊戲,我在做統一存儲的數據。錯誤而與團結

我的問題是,我想通過電子郵件發送的數據真實的應用程序。一切工作正常,電子郵件與數據等發送。但是,當我建立應用程序到iOS設備它不發送電子郵件。

我沒有團結的任何錯誤,但是當我建立app.See下面的錯誤,我得到在Xcode這個錯誤。我希望有一個人可以幫助我。

問候,

格奧爾基·利維

MissingMethodException: Method not found: 'Default constructor not found...ctor() of System.Net.Configuration.MailSettingsSectionGroup'. 
    at Mono.Security.Authenticode.AuthenticodeBase.GetSecurityEntry() [0x00000] in <filename unknown>:0 
    at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <filename unknown>:0 
    at System.Configuration.Configuration.GetSectionGroupInstance (System.Configuration.SectionGroupInfo group) [0x00000] in <filename unknown>:0 
    at System.Configuration.ConfigurationSectionGroupCollection.get_Item (System.String name) [0x00000] in <filename unknown>:0 
    at System.Configuration.Configuration.GetSection (System.String path) [0x00000] in <filename unknown>:0 
    at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filename unknown>:0 
    at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0 
    at System.Net.Mail.SmtpClient..ctor (System.String host, Int32 port) [0x00000] in <filename unknown>:0 
    at MonoGmail.Start() [0x00000] in <filename unknown>:0 

(Filename: currently not available on il2cpp Line: -1) 

加入@programmers解決方案,並得到了新的混合錯誤。

MissingMethodException: Method not found: 'Default constructor not found...ctor() of System.Net.Configuration.MailSettingsSectionGroup'. 
    at StartMenu.CloseApp() [0x00000] in <filename unknown>:0 
    at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in <filename unknown>:0 
    at System.Configuration.ConfigInfo.CreateInstance() [0x00000] in <filename unknown>:0 
    at System.Collections.Generic.Comparer`1[T].get_Default() [0x00000] in <filename unknown>:0 
    at System.Configuration.Configuration.GetSectionGroupInstance (System.Configuration.SectionGroupInfo group) [0x00000] in <filename unknown>:0 
    at System.Configuration.ConfigurationSectionGroupCollection.get_Item (System.String name) [0x00000] in <filename unknown>:0 
    at System.Configuration.Configuration.GetSection (System.String path) [0x00000] in <filename unknown>:0 
    at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filename unknown>:0 
    at System.MonoTODOAttribute..ctor() [0x00000] in <filename unknown>:0 
    at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0 
    at System.Net.Mail.SmtpClient..ctor (System.String host, Int32 port) [0x00000] in <filename unknown>:0 
    at System.Net.Mail.SmtpClient..ctor (System.String host) [0x00000] in <filename unknown>:0 
    at Mono_Gmail.Start() [0x00000] in <filename unknown>:0 
    at System.Array.GetGenericValueImpl[T] (Int32 pos, .T& value) [0x00000] in <filename unknown>:0 
    at System.Array.GetGenericValueImpl[T] (Int32 pos, .T& value) [0x00000] in <filename unknown>:0 
    at System.Array.GetGenericValueImpl[T] (Int32 pos, .T& value) [0x00000] in <filename unknown>:0 
    at System.Array.GetGenericValueImpl[T] (Int32 pos, .T& value) [0x00000] in <filename unknown>:0 
System.Array:GetGenericValueImpl(Int32, T&) 
System.Array:GetGenericValueImpl(Int32, T&) 
System.Array:GetGenericValueImpl(Int32, T&) 
System.Array:GetGenericValueImpl(Int32, T&) 

(Filename: currently not available on il2cpp Line: -1) 
+0

可以請你,修正格式? – Farside

+0

併發布錯誤代碼片段。此外,編譯代碼進行調試,然後再試一次(這樣的例外可能是你和其他人更有用) – KevinDTimm

回答

4

這是一個bugIL2CPP。 Unity沒有任何計劃來解決這個問題,因爲有一個臨時的解決方案來解決它。

在你link.xml,添加以下到它。

<linker> 
<assembly fullname="System"> 
<type fullname="System.Net.Configuration.MailSettingsSectionGroup" preserve="all"/> 
<type fullname="System.Net.Configuration.SmtpSection" preserve="all"/> 
<type fullname="System.Net.Configuration.SmtpNetworkElement" preserve="all"/> 
</assembly> 
</linker> 

它基本上告訴Xcode不去掉這些郵件。

如果你沒有link.xml,創建它,並把上面的代碼中它然後將文件中的資源文件夾。重建項目。

編輯

根據下面的comments之一,它現在需要添加下面太行:

<type fullname="System.Net.Configuration.SmtpSpecifiedPickupDirect‌​oryElement" preserve="all"/> 
+0

但如果我這樣做會是否仍然可以發送數據我想真正的電子郵件? –

+0

??這將解決你在xCode中的錯誤。假設你在windows上工作的代碼,它應該在iOS上工作。 – Programmer

+0

從未在Windows上測試過,它適用於MacBook Pro。對不起,沒有添加到問題信息。 –