- Home /
IL2CPP stripping help.
Hello there,
Relevant Info: iOS, IL2CPP, stripping disabled, works in Mono2x
Situation:
My emailing script doesn't work because some of the types used in it are being stripped out. The problem is that System.Net.Configuration.MailSettingsSectionGroup's constructor keeps getting stripped regardless if it's in the link.xml or not. I've seen on the help forms that Josh Peterson has said to add it to the link.xml file and he provides a link (http://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html) but apparently I can't do anything right because it's still being stripped. my link.xml which is in my assets folder is also provided below.
Question:
Can someone help me figure out how stop System.Net.Configuration.MailSettingsSectionGroup from being stripped. My link.xml has become a large tangled mess because of my lack of understanding.
Thanks in advance for all you help! have a great day.
Xcode Error:
MissingMethodException:
Method not found: 'Default constructor not found...ctor() of
System.Net.Configuration.MailSettingsSectionGroup'.
Link.xml:
<linker>
<assembly fullname="System">
<type fullname="System.Net.Configuration.MailSettingsSectionGroup" perserve="all"/>
<type fullname="System.Net.Configuration.WebRequestModuleHandler" preserve="all"/>
<type fullname="System.Net.HttpRequestCreator" preserve="all"/>
<type fullname="System.Net.FileWebRequestCreator" preserve="all"/>
<type fullname="System.Net" preserve="all"/>
<type fullname="System.Net.Mail" preserve="all"/>
<type fullname="System.Net.Security" preserve="all"/>
<type fullname="System.Net.Configuration.NetSectionGroup" preserve="all"/>
<type fullname="System.Net.Configuration.SettingsSection" preserve="all"/>
<type fullname="System.Net.Configuration.Ipv6Element" preserve="all"/>
<type fullname="System.Net.Configuration.WebRequestModulesSection" preserve="all"/>
<type fullname="System.Net.Configuration.WebRequestModuleElementCollection" preserve="all"/>
<type fullname="System.ComponentModel.TypeConverter" preserve="all"/>
<type fullname="System.ComponentModel.ArrayConverter" preserve="all"/>
<type fullname="System.ComponentModel.BaseNumberConverter" preserve="all"/>
<type fullname="System.ComponentModel.BooleanConverter" preserve="all"/>
<type fullname="System.ComponentModel.ByteConverter" preserve="all"/>
<type fullname="System.ComponentModel.CharConverter" preserve="all"/>
<type fullname="System.ComponentModel.CollectionConverter" preserve="all"/>
<type fullname="System.ComponentModel.ComponentConverter" preserve="all"/>
<type fullname="System.ComponentModel.CultureInfoConverter" preserve="all"/>
<type fullname="System.ComponentModel.DateTimeConverter" preserve="all"/>
<type fullname="System.ComponentModel.DecimalConverter" preserve="all"/>
<type fullname="System.ComponentModel.DoubleConverter" preserve="all"/>
<type fullname="System.ComponentModel.EnumConverter" preserve="all"/>
<type fullname="System.ComponentModel.ExpandableObjectConverter" preserve="all"/>
<type fullname="System.ComponentModel.Int16Converter" preserve="all"/>
<type fullname="System.ComponentModel.Int32Converter" preserve="all"/>
<type fullname="System.ComponentModel.Int64Converter" preserve="all"/>
<type fullname="System.ComponentModel.NullableConverter" preserve="all"/>
<type fullname="System.ComponentModel.SByteConverter" preserve="all"/>
<type fullname="System.ComponentModel.SingleConverter" preserve="all"/>
<type fullname="System.ComponentModel.StringConverter" preserve="all"/>
<type fullname="System.ComponentModel.TimeSpanConverter" preserve="all"/>
<type fullname="System.ComponentModel.UInt16Converter" preserve="all"/>
<type fullname="System.ComponentModel.UInt32Converter" preserve="all"/>
<type fullname="System.ComponentModel.UInt64Converter" preserve="all"/>
</assembly>
<assembly fillname="System.Net">
<type fullname="System.Net.Configuration.MailSettingsSectionGroup" perserve="all"/>
<type fullname="System.Net.Configuration.WebRequestModuleHandler" preserve="all"/>
<type fullname="System.Net.HttpRequestCreator" preserve="all"/>
<type fullname="System.Net.FileWebRequestCreator" preserve="all"/>
<type fullname="System.Net" preserve="all"/>
<type fullname="System.Net.Mail" preserve="all"/>
<type fullname="System.Net.Security" preserve="all"/>
<type fullname="System.Net.Configuration.NetSectionGroup" preserve="all"/>
<type fullname="System.Net.Configuration.SettingsSection" preserve="all"/>
<type fullname="System.Net.Configuration.Ipv6Element" preserve="all"/>
<type fullname="System.Net.Configuration.WebRequestModulesSection" preserve="all"/>
<type fullname="System.Net.Configuration.WebRequestModuleElementCollection" preserve="all"/>
</assembly>
<assembly fullname="System.Configuration">
<type fullname="System.Configuration.ExeConfigurationHost" preserve="all"/>
</assembly>
<assembly fullname="mscorlib">
<namespace fullname="System.Security.Cryptography" preserve="all"/>
<namespace fullname="System.Reflection.TargetInvocationException" preserve="all"/>
</assembly>
</linker>
Script Includes:
using UnityEngine;
using System.Collections;
using System;
using System.Net;
using System.Net.Mail;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using UnityEngine.Events;
using UnityEngine.UI;
Answer by ToxicGue · Jul 17, 2015 at 08:00 AM
so it turns out that Link.xml != link.xml on a Mac. i simply renamed the file from Link.xml to link.xml and it worked. (note: the link.xml I provided has many problems would not use it)
Thanks for you post about this problem, I currently have the same one, could you tell me (and the commnity) in which part your link.xml is not good ?
Thanks in advance for that !!! :)
The problem @ToxicGue is describing is that the "L" in Link was upper case but on a mac there is an expectation that the case is sensitive and needed to be a lower "l" in the word "link", so ins$$anonymous$$d of "Link.xml" it worked fine as "link.xml"
@Eonirma the problem with the link.xml file above was that, through my rage I had started to just put namespaces in as assembly names. then, when I got unity to finally find the link.xml file the game would not compile because the linker would look for the namespaces which would not exist in the assembly (or something like that) unity would give me an error saying blank does not exist and could not me preserved (something along that line). To fix this I simply removed the fake assmebly names from the link.xml file. After this everything worked well.
just for completeness, my final link.xml is listed below.
--------------------- NEW link.xml ----------
<linker>
<assembly fullname="System">
<type fullname="System.Net.Configuration.$$anonymous$$ailSettingsSectionGroup" perserve="all"/>
<type fullname="System.Net.Configuration.WebRequest$$anonymous$$oduleHandler" preserve="all"/>
<type fullname="System.Net.HttpRequestCreator" preserve="all"/>
<type fullname="System.Net.FileWebRequestCreator" preserve="all"/>
<type fullname="System.Net" preserve="all"/>
<type fullname="System.Net.$$anonymous$$ail" preserve="all"/>
<type fullname="System.Net.Security" preserve="all"/>
<type fullname="System.Net.Configuration.NetSectionGroup" preserve="all"/>
<type fullname="System.Net.Configuration.SettingsSection" preserve="all"/>
<type fullname="System.Net.Configuration.Ipv6Element" preserve="all"/>
<type fullname="System.Net.Configuration.WebRequest$$anonymous$$odulesSection" preserve="all"/>
<type fullname="System.Net.Configuration.WebRequest$$anonymous$$oduleElementCollection" preserve="all"/>
<type fullname="System.Net.Configuration.SmtpSection" preserve="all"/>
<type fullname="System.Net.Configuration.SmtpNetworkElement" perserve="all"/>
</assembly>
<assembly fullname="System.Configuration">
<type fullname="System.Configuration.ExeConfigurationHost" preserve="all"/>
</assembly>
<assembly fullname="mscorlib">
<namespace fullname="System.Security.Cryptography" preserve="all"/>
<namespace fullname="System.Reflection.TargetInvocationException" preserve="all"/>
</assembly>
</linker>
Thanks a lot @ToxicGue !! :)
Thanks to you I can advance with my development !!! It's kinda weird that Unity don't explain how to make the black list file, don't you think ?
Your answer
![](https://koobas.hobune.stream/wayback/20220611230711im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity3d for iOS, a lot of linker errors after upgrading to Unity 4.5.5 1 Answer
Only recompile scripts instead of full build? 4 Answers
Unity Xcode - Apple Mech-O Linker Error 1 Answer
xCode build fails after upgrading to 4.5 only on automated build project. 1 Answer
Unity XCode build linker error 0 Answers