Android Dotfuscator根检查导致Xamarin中的EncoderCallbackException

Android Dotfuscator根检查导致Xamarin中的EncoderCallbackException,android,xamarin.forms,msbuild,visual-studio-2019,dotfuscator,Android,Xamarin.forms,Msbuild,Visual Studio 2019,Dotfuscator,我使用先发制人的Dotfuscator来混淆我在Android平台上的Xamarin表单应用程序。我能够更早地构建应用程序,但当我将Windows升级到10而不是2019并使用最新版本的Dotfucator社区版本时,相同的DotfuscatorConfig.xml开始出现异常 如果我从DotfuscatorConfig.xml文件中删除根检查,我就能够成功构建。 以下是VS输出以及异常详细信息: 2> Reflection call 'System.Type System.Type::

我使用先发制人的Dotfuscator来混淆我在Android平台上的Xamarin表单应用程序。我能够更早地构建应用程序,但当我将Windows升级到10而不是2019并使用最新版本的Dotfucator社区版本时,相同的DotfuscatorConfig.xml开始出现异常

如果我从DotfuscatorConfig.xml文件中删除根检查,我就能够成功构建。

以下是VS输出以及异常详细信息:

2>  Reflection call 'System.Type System.Type::GetType(System.String)' inside 'System.Boolean PreEmptive.SoS.Runtime.XRFinder::XRFind()' was detected with type name `䌏欑朓戕紗眙㈛嬝丟吡䴣吥䜧䐩䄫䬭帯䘱` which can't be resolved. (TaskId:285)
2>  Reflection call 'System.Reflection.MethodInfo System.Type::GetMethod(System.String,System.Type[])' inside 'System.Boolean PreEmptive.SoS.Runtime.XRFinder::XRFind()' does not use detectable instance type extraction (TaskId:285)
2>  Reflection call 'System.Type System.Type::GetType(System.String)' inside 'System.Boolean PreEmptive.SoS.Runtime.XRFinder::XRFind()' was detected with type name `䌏欑朓戕紗眙㈛圝漟డ琣䜥尧䈩` which can't be resolved. (TaskId:285)
2>  Reflection call 'System.Reflection.MethodInfo System.Type::GetMethod(System.String,System.Type[])' inside 'System.Boolean PreEmptive.SoS.Runtime.XRFinder::XRFind()' does not use detectable instance type extraction (TaskId:285)
2>  Reflection call 'System.Type System.Type::GetType(System.String)' inside 'System.Boolean PreEmptive.SoS.Runtime.XRFinder::XRFind()' was detected with type name `䌏欑朓戕紗眙㈛圝漟డ戣伥䐧伩` which can't be resolved. (TaskId:285)
2>  Reflection call 'System.Reflection.MethodInfo System.Type::GetMethod(System.String,System.Reflection.BindingFlags)' inside 'System.Boolean PreEmptive.SoS.Runtime.XRFinder::XRFind()' does not use detectable instance type extraction (TaskId:285)
2>MSBUILD : error MSB4166: Child node "2" exited prematurely. Shutting down. Diagnostic information may be found in files in "C:\Users\WinUser\AppData\Local\Temp\" and will be named MSBuild_*.failure.txt. This location can be changed by setting the MSBUILDDEBUGPATH environment variable to a different directory.
2>MSBUILD : error MSB4166: C:\Users\WinUser\AppData\Local\Temp\MSBuild_pid-1412_8a13e9d544e74c94b378a56e64d81b58.failure.txt:
2>MSBUILD : error MSB4166: UNHANDLED EXCEPTIONS FROM PROCESS 1412:
2>MSBUILD : error MSB4166: =====================
2>MSBUILD : error MSB4166: 7/9/2020 11:46:12 AM
2>MSBUILD : error MSB4166: System.Text.EncoderFallbackException: Unable to translate Unicode character \uDDA3 at index 235 to specified code page.
2>MSBUILD : error MSB4166:    at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
2>MSBUILD : error MSB4166:    at System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars)
2>MSBUILD : error MSB4166:    at System.Text.UTF8Encoding.GetByteCount(Char* chars, Int32 count, EncoderNLS baseEncoder)
2>MSBUILD : error MSB4166:    at System.Text.UTF8Encoding.GetByteCount(String chars)
2>MSBUILD : error MSB4166:    at System.IO.BinaryWriter.Write(String value)
2>MSBUILD : error MSB4166:    at Microsoft.Build.Framework.BuildEventArgs.WriteToStream(BinaryWriter writer)
2>MSBUILD : error MSB4166:    at Microsoft.Build.Framework.LazyFormattedBuildEventArgs.WriteToStream(BinaryWriter writer)
2>MSBUILD : error MSB4166:    at Microsoft.Build.Framework.BuildMessageEventArgs.WriteToStream(BinaryWriter writer)
2>MSBUILD : error MSB4166:    at Microsoft.Build.Shared.LogMessagePacketBase.WriteToStream(ITranslator translator)
2>MSBUILD : error MSB4166:    at Microsoft.Build.Shared.LogMessagePacketBase.Translate(ITranslator translator)
2>MSBUILD : error MSB4166:    at Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.RunReadLoop(Stream localReadPipe, Stream localWritePipe, ConcurrentQueue`1 localPacketQueue, AutoResetEvent localPacketAvailable, AutoResetEvent localTerminatePacketPump)

您必须注意到初始日志中的中文字符-我想知道这是否是问题的原因。

我是Dotfuscator团队的成员,并以该身份回答

这看起来是Xamarin Android链接器最新更新引入的新问题。我们正在进行内部调查,但目前,您可以禁用链接器:

  • 在VisualStudio中,在解决方案资源管理器中右键单击Android项目并选择属性
  • 转到Android选项
  • 向下滚动到链接器属性
  • 在“链接”下拉列表中,选择“无”
  • (等效的MSBuild属性是
    AndroidLinkMode
    ,设置为
    None

    如果使用此设置进行构建,则应该能够再次注入根检查

    更新:我们已经与Xamarin链接器团队就此进行了沟通。再次感谢您提请我们注意