Xamarin IOS构建System.io.io.filenotfoundException:找不到文件&quot&obj/iPhone/dev/dev/actool/bundle/my20x20.png;

发布于 2025-01-31 22:00:18 字数 854 浏览 3 评论 0原文

我有不同的信息。不同环境的文件文件,例如dev.info.plist。

注意:我在开始构建之前将Dev.Info.plist的所有内容复制并粘贴到info.plist中。

当我构建&在当地运行,我没有问题,但是我建立了&对抗iPhonesimulator。我的CI/CD管道对iPhone运行,由于某种原因,它不会拿起我的图像资产。

错误

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.Shared.targets(1057,3): error : System.IO.FileNotFoundException: Could not find file "/Users/runner/work/1/s/MyApp.iOS/obj/iPhone/Dev/actool/bundle/my20x20.png" [/Users/runner/work/1/s/MyApp.iOS/MyApp.iOS.csproj]

ios csproj

<ImageAsset Include="Assets.xcassets\AppIcons_Dev.appiconset\20.png">
  <Visible>false</Visible>
</ImageAsset>

dev.info.plist

<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcons_Dev.appiconset</string>

I have different Info.plist files for different environments e.g. Dev.Info.plist.

NOTE: I copy and paste all contents of Dev.Info.plist into Info.plist before I start my build.

When I build & run locally, I have no issues but I build & run against iPhoneSimulator. My CI/CD pipeline runs against iPhone and for some reason, it does not pick up my image assets.

Error

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.Shared.targets(1057,3): error : System.IO.FileNotFoundException: Could not find file "/Users/runner/work/1/s/MyApp.iOS/obj/iPhone/Dev/actool/bundle/my20x20.png" [/Users/runner/work/1/s/MyApp.iOS/MyApp.iOS.csproj]

iOS CSPROJ

<ImageAsset Include="Assets.xcassets\AppIcons_Dev.appiconset\20.png">
  <Visible>false</Visible>
</ImageAsset>

Dev.Info.Plist

<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcons_Dev.appiconset</string>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一刻暧昧 2025-02-07 22:00:19

问题在于,我在AssetCatalog中的iOS Appicon的深度为24。

这来自将它们保存为PNG ,而没有标记它们为透明的。当将其标记为透明时,它们的深度为32。

此后,构建管道按预期工作。

The problem was that my iOS AppIcons in the AssetCatalog had a bit depth of 24.

This comes from saving them as PNG without marking them as transparent. When marked as transparent they have a bit depth of 32.

After that, the build pipeline worked as intended.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文