英文:
Error trying to publish .net maui app iOS version using Visual Studio on Windows
问题
我在iOS上开发.NET Maui应用程序。在Android上一切正常,但在iOS上遇到了一些问题。我将Windows PC与安装有Xcode和Visual Studio的macOS Ventura的VMWare机器连接。调试模式正常工作。
我遵循了此教程进行应用程序发布,但尝试发布时遇到以下错误:
错误 MSB4018:“ReadItemsFromFile”任务意外失败。
如果我尝试在PowerShell中执行指南中的命令,我收到以下错误:
无法在指定路径中找到Microsoft.iOS。
我还尝试了按照Microsoft指南操作,但收到了以下错误:
图片链接
我猜我按照两个教程中的说明正确创建了每个应用程序文档,也在我的macOS上下载了该文件“Worldwide Developer Relations - G3(到期日期02/20/2030 00:00:00 UTC)”。有解决方案吗?
英文:
I'm developing an application in .Net Maui for iOS and Android. For Android all is good but I have some problems with iOS. I linked windows pc with a VMWare machine where I put on macOSVentura with xcode and visual studio installed. The debug mode works correctly.
I followed this tutorial for publish the app but when I try to publish it I got this error:
Error MSB4018 The "ReadItemsFromFile" task failed unexpectedly.
System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Xamarin.Messaging.Exceptions.MessagingException: A timeout occurred on client build258046576mtq28 while executing a post for topic xma/agents ---> System.TimeoutException: The operation has timed out.
at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__21`2.MoveNext() in D:\a\_work\s\src\Xamarin.Messaging.Client\MessagingClient.cs:line 188
--- End of inner exception stack trace ---
at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__21`2.MoveNext() in D:\a\_work\s\src\Xamarin.Messaging.Client\MessagingClient.cs:line 239
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Xamarin.Messaging.Ssh.MessagingRunnerPro.<ExecuteWithRetryAsync>d__12`1.MoveNext() in D:\a\_work\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 55
--- End of stack trace from previous location where exception was thrown ---
(the error was much longer)
If I try to execute the command in PowerShell as in the guide I got this error
C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.2.2054\tools\msbuild\iOS\Xamarin.Shared.targets(1738,3): error : Could not find Microsoft.iOS in /Users/username/Library/Caches/Xamarin/XMA/SDKs/dotnet/packs/
Microsoft.iOS.Sdk/16.2.2054/. [C:\Users\localusername\source\repos\appname\appname\appname.csproj::TargetFramework=net7.0-ios]
C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.2.2054\tools\msbuild\iOS\Xamarin.Shared.targets(1738,3): error :
[C:\Users\localusername\source\repos\appname\appname\appname.csproj::T
argetFramework=net7.0-ios]
I also tried to follow the Microsoft guide :
but I got this error
I guess I created correctly every Application documents as in both tutorial, I also downloaded this file 'Worldwide Developer Relations - G3 (Expiring 02/20/2030 00:00:00 UTC)' in my macOS.
Any solution?
答案1
得分: 1
我遇到过类似的错误。尝试关注 info.plist 文件,如果你添加了错误的内容(例如地图),请修复请求或者如果不需要的话删除它。然后再试一次。如果仍然不起作用,尝试将项目传递到虚拟机中,并从 Mac 内部的 Visual Studio 发布它。这对我有用。
英文:
I had a similar error. Try to keep attention on the info.plist file if you added something wrong (for example on the map) fix the request or delete it if you don't need it.
Then try again.
If it still doesn't work, try passing the project into the VM and publishing it from the visual studio inside the mac.
This worked for me.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论