如标题中所述,尝试为 IOS 编译 Xamarin.Forms 应用程序时出现以下链接错误。我正在 Visual Studio for Windows 上开发并使用 MacBook 进行编译。
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(747,3): error : Native linking error: warning: directory not found for option '-F/Users/vvp/Library/Caches/Xamarin/mtbs/builds/RT.iOS/9bd34334c2bb0c14c8bdf794f67e9fc/framework'1>
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(747,3): error: Native linking error: warning: directory not found for option '-F/Users/vvp/Library/Caches/Xamarin/mtbs/builds/RT.iOS/9bd34334c2bb0c14c8bdf794fb67e9fc/framework'
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(747,3): error : Native linking error: framework not found ArcGIS-sim64
直接使用 VS 2017 在 Mac 上编译是可行的。该应用程序在 iPhone Simulator 上部署和运行。我正在使用完全相同的配置。但是,我收到以下警告,我认为这些警告与上面的错误消息一致。
/Users/vvv/Desktop/Selectron.Field.RouteTracker/RT/RT.iOS/warning MT5203: Warning: warning: ignoring file
/Users/vvv/Desktop/Selectron.Field.RouteTracker/packages/Esri.ArcGISRuntime.Xamarin.iOS.100.1.0/framework/ArcGIS-sim.framework/ArcGIS-sim, file was built for i386 which is not the architecture being linked (x86_64):
/Users/vvv/Desktop/Selectron.Field.RouteTracker/packages/Esri.ArcGISRuntime.Xamarin.iOS.100.1.0/framework/ArcGIS-sim.framework/ArcGIS-sim (RT.iOS) Native linking
/Users/vvv/Desktop/Selectron.Field.RouteTracker/packages/Esri.ArcGISRuntime.Xamarin.iOS.100.1.0/framework/ArcGIS-sim.framework/ArcGIS-sim, file was built for i386 which is not the architecture being linked (x86_64):
/Users/vvv/Desktop/Selectron.Field.RouteTracker/packages/Esri.ArcGISRuntime.Xamarin.iOS.100.1.0/framework/ArcGIS-sim.framework/ArcGIS-sim (RT.iOS) Native linking
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(3,3): Warning MSB6002: The command-line for the "MTouch" task is too long. Command-lines longer than 32000 characters are likely to fail. Try reducing the length of the command-line by breaking down the call to "MTouch" into multiple calls with fewer parameters per call. (MSB6002) (RT.iOS)
我曾尝试通过视觉工作室更改支持的架构,但没有运气。
我猜 MAC 上的编译过程提供了某些参数,允许无论如何进行构建。任何有关该主题的文档或想法的建议都将受到赞赏。
尚未在实际设备上进行测试。
确实存在的 MAC 上的 Users/vvp/Library/Caches/Xamarin/mtbs/builds/RT.iOS/9bd34334c2bb0c14c8bdf794fb67e9fc/framework' 中存在的文件是:ArcGIS-sim:动态链接的共享库 i386 ArcGIS-sim64:a 64 位动态链接共享库 x86-64
但是 ArcGis-arm 似乎不存在(它在我的 Windows 机器上可用,而不是 Mac)。
此外,我在我的 IOS 项目文件中收到以下错误,尽管我已经确认有问题的文件存在。
<Error Condition="!Exists('..\..\packages\Esri.ArcGISRuntime.Xamarin.iOS.100.1.0\build\Xamarin.iOS10\Esri.ArcGISRuntime.Xamarin.iOS.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Esri.ArcGISRuntime.Xamarin.iOS.100.1.0\build\Xamarin.iOS10\Esri.ArcGISRuntime.Xamarin.iOS.targets'))" />