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.

MAUI, iOS simulator. "ResolveNativeReferences" exception.

See original GitHub issue

Package

Sentry.Maui

.NET Version

6.0.0 (or 7.0.0)

OS

iOS

SDK Version

3.23.1-preview.3

Steps to Reproduce

  1. Create a new MAUI project.
  2. Open .csproj-file.
  3. Add a reference
<PackageReference Include="Sentry.Maui" Version="3.23.1-preview.3" />
  1. Rebuild this project and try to run it on the iOS simulator.

Expected Result

Project should be successfully started.

Actual Result

This exception is thrown at compile time. It’s 100% about Sentry, cause with other packages I don’t get any errors.

Severity	Code	Description	Project	File	Line	Suppression State
Error	MSB4018	The "ResolveNativeReferences" task failed unexpectedly.
System.AggregateException: One or more errors occurred. ---> System.ComponentModel.Win32Exception: The system cannot find the file specified
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at Xamarin.Utils.Execution.<>c__DisplayClass24_1.<RunAsync>b__0() in /Users/builder/azdo/_work/1/s/xamarin-macios/tools/common/Execution.cs:line 103
--- 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.TaskAwaiter`1.GetResult()
   at Xamarin.MacDev.Tasks.XamarinTask.<ExecuteAsync>d__24.MoveNext() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/XamarinTask.cs:line 120
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Xamarin.MacDev.Tasks.ResolveNativeReferencesBase.ProcessSidecar(ITaskItem r, String resources, List`1 native_frameworks) in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ResolveNativeReferencesBase.cs:line 134
   at Xamarin.MacDev.Tasks.ResolveNativeReferencesBase.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ResolveNativeReferencesBase.cs:line 105
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
---> (Inner Exception #0) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at Xamarin.Utils.Execution.<>c__DisplayClass24_1.<RunAsync>b__0() in /Users/builder/azdo/_work/1/s/xamarin-macios/tools/common/Execution.cs:line 103
--- 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.TaskAwaiter`1.GetResult()
   at Xamarin.MacDev.Tasks.XamarinTask.<ExecuteAsync>d__24.MoveNext() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/XamarinTask.cs:line 120<---
	MauiApp2	C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.0.527\tools\msbuild\iOS\Xamarin.Shared.targets	137	

image

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:1
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mattjohnsonpintcommented, Feb 7, 2023

@bozau - Yes - Microsoft is working on this with xamarin/xamarin-macios#16001.

Also, I just developed a workaround we can use for Sentry. It’s not a general-purpose workaround for the whole issue, but it side-steps us running into it by preventing the resources zip file from being created to begin with. It will be released shortly. Thanks.

1reaction
mattjohnsonpintcommented, Nov 29, 2022

Not sure that we’re going to be able to workaround this one. Until Microsoft has a fix, I suggest one of the following:

  • Develop on a Mac, which appear to always work
  • Develop on Windows but deploy to a real device instead of the simulator using “hot restart”. (You’ll need our 3.24.0 release or greater.)
  • Disable Sentry while developing on Windows
    • This may be difficult though, as you’d have to both conditionally exclude the package reference and any code using it.

If a workaround becomes apparent, we’ll add it. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MAUI App launches fine in iOS Simulator, refuses to build ...
When I start building a default MAUI project for a physical iOS device on Visual Studio for Mac Preview 17.3 (build 191) on...
Read more >
Deploying .NET MAUI to IOS Simulator Error
I am having an issue deploying to any iOS simulator using .NET Maui. I receive the following error Failed to install the app...
Read more >
Error adding record: MissingEntity - Microsoft Q&A
When running the [await SecureStorage. SetAsync] command in the MAUI IOS simulator, an error is reported: Error adding record: MissingEntity.
Read more >
MAUI with Blazor iOS, how to debug errors?
Just go to Safari > Development > Look for the simulator > it should probably say something like "localhost" and give it a...
Read more >
Troubleshooting iOS Simulator Crashes when Using ...
When I used the RadCartesianChart and RadPieChart in MAUI with the sample code from https://docs.telerik.com/devtools/maui/controls/chart/types/ ...
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