标签: xamarin-linker

Xamarin iOS 构建错误 - 本机链接失败(仅限链接框架 SDK)

Visual Studio 更新后无法运行 Xamarin iOS 项目。

因为更新的 IDE 需要最新的 Xcode(Xcode 11.4 附带的 iOS 13.4 SDK)

环境详情

  • 操作系统版本:macOS Mojave,OS X 10.14.6
  • IDE:Visual Studio Community 2019 for Mac 版本 8.5.1(内部版本 42)
  • Xamarin.iOS 版本:13.16.0.11(Visual Studio 社区)
  • Xamarin.Mac 版本:6.16.0.11(Visual Studio 社区)
  • Xcode 13.2 版

我试过的

我没有更新 Xcode,而是Linker BehaviourLink Framework SDKs Only.

不走运,我收到以下错误。

Error MT5210: Native linking failed, undefined symbol: ___darwin_check_fd_set_overflow. 
Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210)

Error …
Run Code Online (Sandbox Code Playgroud)

linker-errors xamarin.ios xamarin.forms xamarin-linker

10
推荐指数
2
解决办法
4957
查看次数

Xamarin iOS 发布版本 - 本机链接失败

我无法构建我的 Xamarin iOS 项目。

有用:

  • 在调试模式下使用物理设备
  • 在调试模式下使用模拟器
  • 在模拟器的发布模式下

但它不会工作:

  • 在物理设备的发布模式下!

我试过:

  • 所有链接器行为:没有成功
  • 删除 obj 和 bin 文件夹并重建:没有成功
  • 删除 Library/Caches/mtbs/builds/ 并重建:没有成功
  • 降级 Visual Studio:没有成功
  • 将 --registrar:dynamic 添加到 mtouch 参数:没有成功

NuGet 包:

<PackageReference Include="Acr.UserDialogs" Version="7.1.0.483" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
<PackageReference Include="TouchView" Version="4.1.100" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
<PackageReference Include="Xamarin.Forms.InputKit" Version="3.7.2" />
Run Code Online (Sandbox Code Playgroud)

错误:

Error MT5210: Native linking failed, undefined symbol: _EqualDomainSid. Please verify that all the necessary frameworks have been referenced and native libraries …
Run Code Online (Sandbox Code Playgroud)

xamarin.ios ios xamarin xamarin.forms xamarin-linker

6
推荐指数
0
解决办法
391
查看次数

Xamarin iOS 链接器导致 AutoMapper 问题

我正在开发一个使用 AutoMapper 的 Xamarin 项目。当链接设置为“仅链接框架 SDK”时,初始化地图时出现以下错误

System.ArgumentNullException:值不能为空。参数名称:方​​法

异常并不多,调用堆栈也没有

AutoMapper.Mappers.ConvertMapper.MapExpression
AutoMapper.Execution.TypeMapPlanBuilder.ObjectMapperExpression
AutoMapper.Execution.TypeMapPlanBuilder.MapExpression
AutoMapper.Mappers.NullableSourceMapper.MapExpression
AutoMapper.Execution.TypeMapPlanBuilder.ObjectMapperExpression
AutoMapper.Execution.TypeMapPlanBuilder.MapExpression
AutoMapper.Execution.TypeMapPlanBuilder.MapExpression
AutoMapper .Execution.TypeMapPlanBuilder.CreatePropertyMapFunc
AutoMapper.Execution.TypeMapPlanBuilder.CreatePropertyMapFunc
AutoMapper.Execution.TypeMapPlanBuilder.TryPropertyMap
AutoMapper.Execution.TypeMapPlanBuilder.CreateAssignmentFunc
AutoMapper.Execution.TypeMapPlanBuilder.CreateMapperLambda
AutoMapper.TypeMap.Seal AutoMapper.MapperConfiguration.Seal
AutoMapper.MapperConfiguration..ctor
AutoMapper.MapperConfiguration..ctor AutoMapper.Mapper.Initialize

最初的阅读表明链接器只是从我们正在使用的某个类中删除了一些属性或方法。

但是,在注释掉大部分映射然后一次重新引入一个之后,我发现这个类当前导致了错误。

[Preserve]
internal class ItemBase : CareRecordItemBase
{
      [Preserve]
      public string Topic { get; set; }
    
      [Preserve]
      public string InPractice { get; set; }
    
      [Preserve]
      public string PrivateVal { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

如果我注释掉该InPractice属性,则不会抛出异常。这对我来说毫无意义。谁能解释为什么这可能是一个问题?

是否有更好的方法来诊断这些问题?

automapper xamarin.ios ios xamarin-linker

3
推荐指数
1
解决办法
496
查看次数