简体   繁体   English

Build MessagingRemoteException、DirectoryNotFoundException 上的 Xamarin.iOS 错误

[英]Xamarin.iOS Error on Build MessagingRemoteException, DirectoryNotFoundException

I encountered this error upon building the app.我在构建应用程序时遇到了这个错误。 I could not build successfully.我无法成功构建。 (Xamarin on Visual Studio Enterprise 2015, Xamarin Mac Agent is already connected) (Xamarin on Visual Studio Enterprise 2015,Xamarin Mac Agent 已经连接)

1>C:\\Program Files (x86)\\MSBuild\\Xamarin\\iOS\\Xamarin.iOS.Common.targets(1025,3): error : MessagingRemoteException: An error occured on client Build42211 while executing a reply for topic xvs/Build/4.2.2.11/execute-task/CompanyName.iOS/83ecc20%2FACTool 1>C:\\Program Files (x86)\\MSBuild\\Xamarin\\iOS\\Xamarin.iOS.Common.targets(1025,3): error : MessagingRemoteException: 客户端 Build42211 在执行主题 xvs/Build/ 的回复时发生错误4.2.2.11/execute-task/CompanyName.iOS/83ecc20%2FACTool

1>C:\\Program Files (x86)\\MSBuild\\Xamarin\\iOS\\Xamarin.iOS.Common.targets(1025,3): error : DirectoryNotFoundException: Could not find a part of the path "/Users/glennrodriguez/Library/Caches/Xamarin/mtbs/builds/CompanyName.iOS/83ecc20ddd53d18137bcee59a20ad010/Resources/Images.xcassets/AppIcons.appiconset/Contents.json". 1>C:\\Program Files (x86)\\MSBuild\\Xamarin\\iOS\\Xamarin.iOS.Common.targets(1025,3):错误:DirectoryNotFoundException:找不到路径的一部分“/Users/glennrodriguez/Library/缓存/Xamarin/mtbs/builds/CompanyName.iOS/83ecc20ddd53d18137bcee59a20ad010/Resources/Images.xcassets/AppIcons.appiconset/Contents.json”。

I have seen this issue before and it usually is resolved by cleaning the project and clearing the build cache on the Mac.我以前见过这个问题,通常通过清理项目并清除 Mac 上的构建缓存来解决。

The build server cache is located on the Mac build host in the folder: ~/Library/Caches/Xamarin/mtbs Note that the ~/Library folder is hidden by default in Finder, so if need be use Finder's Go->Go to Folder menu and enter ~/Library/Caches/Xamarin/mtbs to open the folder.构建服务器缓存位于 Mac 构建主机上的文件夹中: ~/Library/Caches/Xamarin/mtbs注意~/Library文件夹在 Finder 中默认是隐藏的,所以如果需要使用 Finder 的 Go->Go to Folder菜单并输入~/Library/Caches/Xamarin/mtbs以打开文件夹。 You can safely delete the sub-folders of the above folder to clear the build cache on the build host.您可以安全地删除上述文件夹的子文件夹以清除构建主机上的构建缓存。

In addition to what jgoldberger is saying, you can try the following found at this link: https://xamarin.github.io/bugzilla-archives/45/45083/bug.html comments 8 and 9 were very helpful.除了 jgoldberger 所说的内容之外,您还可以尝试在此链接中找到的以下内容: https ://xamarin.github.io/bugzilla-archives/45/45083/bug.html 评论 8 和 9 非常有帮助。

For me, the solution I am working on had been Merged or Branched in TFS.对我来说,我正在研究的解决方案是在 TFS 中合并或分支的。 When this occurs it creates an ItemGroup for the AppIcons in your Media.xcassets.发生这种情况时,它会为 Media.xcassets 中的 AppIcons 创建一个 ItemGroup。 This propagates the erros you are seeing.这会传播您所看到的错误。 In the past I have used jgoldberger's solution and it worked fine for me.过去我使用过 jgoldberger 的解决方案,对我来说效果很好。 But just yesterday deleting the builds folder on the build machine did not work.但就在昨天,删除构建机器上的构建文件夹不起作用。 The following steps helped get me up and running again.以下步骤帮助我重新启动并运行。

Right-click on your iOS project and unload your iOS project.右键单击您的 iOS 项目并卸载您的 iOS 项目。 Right-click and edit your iOS project.右键单击并编辑您的 iOS 项目。 Find the ItemGroup below and remove the entire ItemGroup.找到下面的 ItemGroup 并删除整个 ItemGroup。

<ItemGroup>
    <ImageAsset Include="Media.xcassets\AppIcons.appiconset\AppIcon.png">
      <Visible>false</Visible>
    </ImageAsset>
    <ImageAsset Include="Media.xcassets\AppIcons.appiconset\Contents.json">
      <Visible>false</Visible>
    </ImageAsset>
    <ImageAsset Include="Media.xcassets\AppIcons.appiconset\mylogoicon.png">
      <Visible>false</Visible>
    </ImageAsset>
    <ImageAsset Include="Media\AppIcons.appiconset\Contents.json">
      <Visible>false</Visible>
    </ImageAsset>
    <ImageAsset Include="Media\LaunchImages\Contents.json">
      <Visible>false</Visible>
    </ImageAsset>
  </ItemGroup>

Perform a clean solution, remove the builds as jgoldberger suggest in your ~/Library/Caches/Xamarin/mtbs , and rebuild after that.执行干净的解决方案,按照 jgoldberger 建议在您的 ~/Library/Caches/Xamarin/mtbs 中删除构建,然后重建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM