sentry-dotnet: Unable to build MAUI application for iOS
Package
Sentry.Maui
.NET Flavor
.NET
.NET Version
7.0.302
OS
iOS
SDK Version
3.33.0
Self-Hosted Sentry Version
No response
Steps to Reproduce
Attempt to debug the application found https://github.com/pikausp/SentryMauiRepro on a remote (connected to Mac) iPhone.
Expected Result
The application is successfully deployed and debugging starts.
Actual Result
The build fails with the following error
Build started...
1>------ Build started: Project: SentryMauiRepro, Configuration: Release Any CPU ------
1>Executing SayHello Task to establish a connection to a Remote Server.
1> Properties:
1> SessionId=6eaa184a2531710eadd0e538496d7006fd9b8035b5bdacf9a6e11e4424e7022b,
1> Addresss=192.168.0.144,
1> SshPort=22,
1> TcpPort=54990,
1> User=macUser,
1> AppName=SentryMauiRepro,
1> VisualStudioProcessId=48640,
1> ContinueOnDisconnected=False
1>Executing SayHello Task to establish a connection to a Remote Server.
1> Properties:
1> SessionId=6eaa184a2531710eadd0e538496d7006fd9b8035b5bdacf9a6e11e4424e7022b,
1> Addresss=192.168.0.144,
1> SshPort=22,
1> TcpPort=54990,
1> User=macUser,
1> AppName=SentryMauiRepro,
1> VisualStudioProcessId=48640,
1> ContinueOnDisconnected=False
1>Detected signing identity:
1> Code Signing Key: "Apple Development: Created via API (******)" (******)
1> Provisioning Profile: "VS: WildCard Development" (******)
1> Bundle Id: com.companyname.sentrymauirepro
1> App Id: ******.com.companyname.sentrymauirepro
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.7054\targets\Xamarin.Shared.Sdk.targets(2014,3): error : MessagingRemoteException: An error occurred on client Build1647054 while executing a reply for topic xvs/build/16.4.7054/execute-task/SentryMauiRepro/6eaa184002fGetFileSystemEntries
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.7054\targets\Xamarin.Shared.Sdk.targets(2014,3): error : DirectoryNotFoundException: Could not find a part of the path '/Users/macUser/Library/Caches/Xamarin/mtbs/builds/SentryMauiRepro/6eaa184a2531710eadd0e538496d7006fd9b8035b5bdacf9a6e11e4424e7022b/C:/Users/pikau/.nuget/packages/sentry.bindings.cocoa/3.33.0/lib/net6.0-ios16.1/Sentry.Bindings.Cocoa.resources'.
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.7054\targets\Xamarin.Shared.Sdk.targets(2014,3): error :
1>Done building project "SentryMauiRepro.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 4:48 PM and took 12.835 seconds ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
========== Deploy started at 4:48 PM and took 12.835 seconds ==========
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 15 (8 by maintainers)
I can confirm I manually removed the line where
SessionIdis set as instructed in this comment https://github.com/xamarin/xamarin-macios/issues/18308#issuecomment-1559808140 and after restarting Visual Studio I am able to build and deploy the repro project and my regular project.For anyone else encountering the error “The connection cannot continue because the remote iOS SDK was not found or is corrupted” when connecting to the mac:
In my case it was caused by having removed “net7.0-ios” from csproj TargetFrameworks (because I was working mostly on Android at the time). Adding it back made VS install all the dependencies and connect successfully.
Would be nice if VS detected this condition and gave an appropriate error (csproj no configured for iOS).
Sadly I cannot use Hot Restart due to the challenges it poses. We have a dependency on Realm database which does not support deployment via Hot Restart 😦
After running
dotnet workload updateon my Windows workstation I cannot even connect to the Mac anymore. I get the following errorThe connection cannot continue because the remote iOS SDK was not found or is corrupted. If the issue persists, please try removing the ~/Library/Caches/Xamarin/XMA/SDKs/dotnet/ folder on the Mac and try againI tried the suggestion, didn’t work. I then reset the Mac completely, didn’t work either. Ended up reinstalling Visual Studio, but I’m still getting the same error.
I will update you when I manage to get past this error.
When I browse the
Cachefolder on the Mac there are other package folders, but the Sentry folder is completely missing.