question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to build MAUI application for iOS

See original GitHub issue

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 ==========

Issue Analytics

  • State:closed
  • Created 4 months ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
pikauspcommented, May 26, 2023

I can confirm I manually removed the line where SessionId is 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.

1reaction
philipagcommented, Aug 3, 2023

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).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot known issues - .NET MAUI
NET MAUI apps that target iOS or Mac Catalyst. In this scenario, check that you also have Xcode installed from the App Store....
Read more >
Can't build MAUI app for connected iPad, error message ...
I installed Visual Studio Mac v17.6.1 (build 452), on a MacBook pro running Ventura 13.4.1, with Xcode 14.3.1 present on the machine.
Read more >
App failing to install in release mode but working in debug
A rant about .NET MAUI: App failing to install in release mode but working in debug.
Read more >
Can't Build a .NET MAUI iOS Solution - works via CLI
I downloaded the code from this project here: https://github.com/codemonkey85/DotNetMauiBeginnersCourse When I build the project, ...
Read more >
Fails to build maui app from windows to iOS through mac
Fails to build maui app from windows to iOS through mac ... Error in build: C:\Program Files\dotnet\packs\Microsoft.iOS.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found