unoplatform / uno

Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
https://platform.uno
Apache License 2.0
8.51k stars 690 forks source link

The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core. #15689

Open mniczyporuk opened 3 months ago

mniczyporuk commented 3 months ago

Type: Bug

Current Behavior

The error occurs while building the first app build with the Uno platform

Expected Behavior

Any other .net project builds without such an error (e.g. .NET MAUI)

How to reproduce it (as minimally and precisely as possible)

Create Uno platform mobile app project, and try to build debug version (without any code modifications in the freshly created project)

Workaround

none

Extension Status

Extension: Dev Kit Mode Debugger: Ready Hot-Reload: Running on port 59543 XAML LSP: Ready

Environment information

Extension version: 0.13.0 VS Code version: Code 1.87.0 (019f4d1419fbc8219a181fab7892ebccf7ee29a2, 2024-02-27T23:42:51.279Z) OS version: Darwin arm64 23.3.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M2 Pro (10 x 24)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|2, 4, 3| |Memory (System)|16.00GB (0.07GB free)| |Process Argv|--crash-reporter-id 688b0970-e37b-42d9-98a2-b73c16d9d270| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscoreces:30445986 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:30899288 c4g48928:30535728 azure-dev_surveyonecf:30548226 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 2e7ec940:30968132 pythontbext0:30879054 accentitlementst:30887150 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 pydisww2:30959801 cppperfnew:30973185 8082a590:30971561 edj9j583:30969295 a89i1917:30973842 e3gdj431:30958358 ccp1r3:30958155 dsvsc020cf:30973509 ```
mniczyporuk commented 3 months ago

A fatal error was encountered. The library 'libhostpolicy.dylib' required to execute the application was not found

spouliot commented 3 months ago

The target process exited without raising a CoreCLR started event.

@mniczyporuk This often means you're trying to execute a Mono-based application with the .NET debugger.

Which project (.csproj file) and target framework are selected when you hit F5 ?

Have you been asked to select a debugger ? If so then you must use the Uno Platform .NET Debugger as it will switch between Mono and .NET debugger depending on your target platform.

IOW using the .NET debugger is possible only if you are debugging a non-Mono-based application, e.g. Gtk-Skia.

Mobile targets such as iOS, Mac(Catalyst) and Android are all Mono-based.

mniczyporuk commented 3 months ago

I created the Uno project "ProjectName" using the web wizard https://new.platform.uno. Opened project folder In vscode and selected "ProjectName.csproj" for uno platform.

When hit F5 by default selected debugger is "Uno platform mobile", and the error occurs. When I change the debugger manually to "Debug (Chrome, WebAssembly)" the project builds with no error and the app starts in Chrome. When reverting to "uno platform mobile" debugger then the build fails again.

spouliot commented 3 months ago

The mobile targets are defined in their own project located at ProjectName.Mobile/ProjectNameMobile.csproj.

Once you selected this project (it can be done from the status bar) you'll be able to select targets (also in the status bar) like net8.0-android, net8.0-ios and net8.0-maccatalyst and, if needed, the simulator/emulator/device where the app should be executed.

No additional changes are required to the launch.json file as long as you use the default Uno platform mobile configuration.

mniczyporuk commented 3 months ago

When I set active project to "ProjectName.Mobile" and target to any platform, e.g. "net8.0-ios" I get the error "MSB4057: The target "GetTargetFrameworksWithPlatformForSingleTargetFramework" does not exist in the project."

mniczyporuk commented 3 months ago

When I set active project to "ProjectName.csproj" and target e.g. "net8.0-ios" then project builds, but can't install/deploy the app to iOS simulator, and in Debug console says :

An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2): Simulator device returned an error for the requested operation. An application bundle was not found at the provided path. Provide a valid path to the desired application bundle.

mniczyporuk commented 3 months ago

In "ProjectName.csproj" as active and target to "net8.0-android" then I get the error in Debug Console "No signed .apk package found under ".

mniczyporuk commented 3 months ago

I'm working on macos, and when "ProjectName.csproj" is active and target is set to "net8.0-maccatalyst" then I get the error in Debug console:

Launch failed with exit code 1. The file .../ProjectName.app does not exist.

spouliot commented 3 months ago

When I set active project to "ProjectName.Mobile" and target to any platform, e.g. "net8.0-ios" I get the error "MSB4057: The target "GetTargetFrameworksWithPlatformForSingleTargetFramework" does not exist in the project."

hmm... I got that error once (c.c. @jeromelaban) but it went away.

Can you try a dotnet clean in the terminal and then hit F1 in VSCode and select Developer: Reload Window. Finally select the mobile project and try again.

If this still happens please attach the ProjectName.Mobile/net8.0-ios-Debug-iossimulator-x64.binlog to the issue. Last time the GetTargetFrameworksWithPlatformForSingleTargetFramework was clearly present in the logs so it's not clear why this later became an error.

In "ProjectName.csproj" as active ...

This is not an executable project but a library project (that targets, among others, all mobile platforms).

Like other .net libraries it cannot be directly debugged, you need to start (or provide) an executable.

The reason it works for WebAssembly is because launch.json has a special configuration to starts the ProjectName.Wasm as a server.

mniczyporuk commented 3 months ago

Many thanks for your support, however, the error still occurs. Attached the ProjectName.Mobile/net8.0-ios-Debug-iossimulator-x64.binlog (zipped). net8.0-ios-Debug-iossimulator-x64.binlog.zip

Additionally, when using "dotnet clean" in the terminal two errors appear:

1) error NETSDK1047: Assets file '.../ProjectName.Mobile/obj/project.assets.json' doesn't have a target for 'net8.0-maccatalyst/maccatalyst-arm64'. Ensure that restore has run and that you have included 'net8.0-maccatalyst' in the TargetFrameworks for your project. You may also need to include 'maccatalyst-arm64' in your project's RuntimeIdentifiers. [.../ProjectName.Mobile.csproj::TargetFramework=net8.0-maccatalyst]

2) error NETSDK1047: Assets file '.../ProjectName.Mobile/obj/project.assets.json' doesn't have a target for 'net8.0-ios/iossimulator-arm64'. Ensure that restore has run and that you have included 'net8.0-ios' in the TargetFrameworks for your project. You may also need to include 'iossimulator-arm64' in your project's RuntimeIdentifiers. [.../ProjectName.Mobile.csproj::TargetFramework=net8.0-ios]

spouliot commented 3 months ago

Thanks I'll have a look at the binlog ASAP!

Additionally, when using "dotnet clean" in the terminal two errors appear:

Are you in the root ProjectName or the mobile ProjectName.Mobile directory when you did the clean ?

Since we want a clean for everything it would be best to do this inside the ProjectName directory.

This is why it looks like for me: https://gist.github.com/spouliot/f4df3fd5db1b89154f42d2426ae50e29 but it can differ a bit depending on your template choices and what has been built so far.

If that does not work, try to do it manually.

  1. Make sure you have the latest Uno extension (0.13)
  2. Close all running instances of VSCode
  3. Inside the ProjectName directory execute the following commands inside a terminal
find . -name bin | xargs rm -rf
find . -name obj | xargs rm -rf
find . -name '*.csproj.user' | xargs rm

That will delete all bin and obj directories (and anything under them) and any .csproj.user file (which could be incorrect if generated with version 0.12 of the extension).

  1. Restart VSCode
  2. Open the ProjectName directory
  3. Select the ProjectName.Mobile.csproj project (status bar)
  4. Pick a target, e.g. net8.0-ios
  5. Pick an simulator or device
  6. Hit F5
spouliot commented 3 months ago

When I set active project to "ProjectName.csproj" and target e.g. "net8.0-ios" then project builds, but can't install/deploy the app to iOS simulator, and in Debug console says :

An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2): Simulator device returned an error for the requested operation. An application bundle was not found at the provided path. Provide a valid path to the desired application bundle.

What was the text just before that error ?

Did it look like

/Users/poupou/git/templates/uno/5.1.25-blank/unoapp/unoapp.Mobile/bin/Debug/
bin/Debug/net8.0-ios/iossimulator-x64/unoapp.Mobile.app could not be installed on simulator 8BC6CEFB-51AB-439C-8681-6AD916C621E1.

where the path is kind of split on two lines ?

That's a problem with dotnet 8.0.20x. You need to update the Uno extension to 0.13 to workaround this issue.

EDIT

Extension version: 0.13.0

In your original description you already seem to be running 0.13.0 so this probably does not apply.

mniczyporuk commented 3 months ago

I'm evaluating Uno Platform, planning a migration from .NET MAUI, therefore I created a dummy first project to start my assessment:

the following command is created by Uno app wizard:

dotnet new unoapp -o ProjectName -preset "recommended" -id "com.companyname.ProjectName" -pub "O=ProjectName" -theme-service -theme "material" -presentation "mvux" -config -di -log "default" -nav "regions" -http -loc -server -tests "unit" -tests "ui" -toolkit -dsp

mniczyporuk commented 3 months ago

when it comes to "dotnet clean" in the terminal, these two errors occur regardless root folder I'm in, either "ProjectName" or "ProjectName.Mobile".

the complete message is the following:

"/Users/marcinniczyporuk/Projects/ProjectName/ProjectName.sln" (Clean target) (1) -> "/Users/marcinniczyporuk/Projects/ProjectName/ProjectName.Mobile/ProjectName.Mobile.csproj" (Clean target) (3) -> "/Users/marcinniczyporuk/Projects/ProjectName/ProjectName.Mobile/ProjectName.Mobile.csproj" (Clean target) (3:3) -> (ResolvePackageAssets target) -> /usr/local/share/dotnet/sdk/8.0.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1047: Assets file '/Users/marcinniczyporuk/Projects/ProjectName/ProjectName.Mobile/obj/project.assets.json' doesn't have a target for 'net8.0-maccatalyst/maccatalyst-arm64'. Ensure that restore has run and that you have included 'net8.0-maccatalyst' in the TargetFrameworks for your project. You may also need to include 'maccatalyst-arm64' in your project's RuntimeIdentifiers. [/Users/marcinniczyporuk/Projects/ProjectName/ProjectName.Mobile/ProjectName.Mobile.csproj::TargetFramework=net8.0-maccatalyst]

   "/Users/marcinniczyporuk/Projects/ProjectName/ProjectName.sln" (Clean target) (1) ->
   "/Users/marcinniczyporuk/Projects/ProjectName/ProjectName.Mobile/ProjectName.Mobile.csproj" (Clean target) (3) ->
   "/Users/marcinniczyporuk/Projects/ProjectName/ProjectName.Mobile/ProjectName.Mobile.csproj" (Clean target) (3:4) ->
     /usr/local/share/dotnet/sdk/8.0.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1047: Assets file '/Users/marcinniczyporuk/Projects/ProjectName/ProjectName.Mobile/obj/project.assets.json' doesn't have a target for 'net8.0-ios/iossimulator-arm64'. Ensure that restore has run and that you have included 'net8.0-ios' in the TargetFrameworks for your project. You may also need to include 'iossimulator-arm64' in your project's RuntimeIdentifiers. [/Users/marcinniczyporuk/Projects/ProjectName/ProjectName.Mobile/ProjectName.Mobile.csproj::TargetFramework=net8.0-ios]
mniczyporuk commented 3 months ago

I just I created another one "ProjectName" project again from scratch using Uno app wizard. This time I selected "ProjectName.Mobile" as an active project, and the target "net80-ios" (built and deployed in the simulator without issues) then changed target to ".net8.0-android" (built and deployed in the simulator without issues).

However when I did "dotnet clean" in the terminal (regardless root folder ProjectName or ProjectName.Mobile") the two errors still occur, as mentioned in my comment above.

mniczyporuk commented 3 months ago

Thanks I'll have a look at the binlog ASAP!

Additionally, when using "dotnet clean" in the terminal two errors appear:

Are you in the root ProjectName or the mobile ProjectName.Mobile directory when you did the clean ?

Since we want a clean for everything it would be best to do this inside the ProjectName directory.

This is why it looks like for me: https://gist.github.com/spouliot/f4df3fd5db1b89154f42d2426ae50e29 but it can differ a bit depending on your template choices and what has been built so far.

If that does not work, try to do it manually.

  1. Make sure you have the latest Uno extension (0.13)
  2. Close all running instances of VSCode
  3. Inside the ProjectName directory execute the following commands inside a terminal
find . -name bin | xargs rm -rf
find . -name obj | xargs rm -rf
find . -name '*.csproj.user' | xargs rm

That will delete all bin and obj directories (and anything under them) and any .csproj.user file (which could be incorrect if generated with version 0.12 of the extension).

  1. Restart VSCode
  2. Open the ProjectName directory
  3. Select the ProjectName.Mobile.csproj project (status bar)
  4. Pick a target, e.g. net8.0-ios
  5. Pick an simulator or device
  6. Hit F5

Let me check it later today, and I will revert.

spouliot commented 3 months ago

Someone reported a similar issue on our Discord server. Removing the ProjectName.Mobile.csproj.user file (created with 0.12 or earlier) was the solution.

mniczyporuk commented 3 months ago

Thanks I'll have a look at the binlog ASAP!

Additionally, when using "dotnet clean" in the terminal two errors appear:

Are you in the root ProjectName or the mobile ProjectName.Mobile directory when you did the clean ? Since we want a clean for everything it would be best to do this inside the ProjectName directory. This is why it looks like for me: https://gist.github.com/spouliot/f4df3fd5db1b89154f42d2426ae50e29 but it can differ a bit depending on your template choices and what has been built so far. If that does not work, try to do it manually.

  1. Make sure you have the latest Uno extension (0.13)
  2. Close all running instances of VSCode
  3. Inside the ProjectName directory execute the following commands inside a terminal
find . -name bin | xargs rm -rf
find . -name obj | xargs rm -rf
find . -name '*.csproj.user' | xargs rm

That will delete all bin and obj directories (and anything under them) and any .csproj.user file (which could be incorrect if generated with version 0.12 of the extension).

  1. Restart VSCode
  2. Open the ProjectName directory
  3. Select the ProjectName.Mobile.csproj project (status bar)
  4. Pick a target, e.g. net8.0-ios
  5. Pick an simulator or device
  6. Hit F5

Let me check it later today, and I will revert.

I was able to clean all. And when in "ProjectName" as root I did "dotnet restore" and then "dotnet clean" and now cleaning is going without any errors through entire solution (all projects).

Thanks for your help.

mniczyporuk commented 3 months ago

Someone reported a similar issue on our Discord server. Removing the ProjectName.Mobile.csproj.user file (created with 0.12 or earlier) was the solution.

It wasn't an issue in my case as I was already in 0.13.

mniczyporuk commented 3 months ago

In Summary, now I am able to build targets for Android, iOS, MacOS (I didn't test Windows target as I do not have Windows machine). Cleaning also works fine, without any errors.

mniczyporuk commented 3 months ago

However, I have encountered another problem, I can't deploy to the iOS devices (all works fine in iOS simulators only). When I chose target "net8.0-ios" and I point to the iOS device connected (not iOS simulator), then no errors during build (except couple of warnings) but the application is not deployed to the device.

After the building process completes I expect the debugger is started, and the application to be deployed to the iOS device. However, it doesn't work as expected. In the vscode Output windows under "Uno Platform - Debugger" filter I can see messages indicating that debugger session starts and immediately ends:

Info] Starting debugging session for: Uno: net8.0-ios | Debug | ios-arm64 [Info] Ending debugging session for: Uno: net8.0-ios | Debug | ios-arm64

spouliot commented 3 months ago

It wasn't an issue in my case as I was already in 0.13.

If you previously used 0.12 then the generated ProjectName.Mobile.csproj.user could be incorrect. Updating to 0.13 solves the problem, it's generated correctly, but it might not replace an existing file (depending on several conditions).

In Summary, now I am able to build targets for Android, iOS, MacOS (I didn't test Windows target as I do not have Windows machine). Cleaning also works fine, without any errors.

Glad to hear this 😄

However, I have encountered another problem, I can't deploy to the iOS devices

The Debug Console should have more details. It's where the external tools (to deploy and start the app) will log their output.

To rule out any hardware (like bad cables) and configuration issues (like code signing) it's often useful to try to deploy an app (just a template) from Xcode.

mniczyporuk commented 3 months ago

All is working fine with my iOS devices deployment in my other projects in Xcode as well as .NET Maui. The problem is only now when try to build Uno platform project. I'm very new to Uno, just wanted to give it a try.

spouliot commented 3 months ago

All is working fine with my iOS devices deployment in my other projects in Xcode as well as .NET Maui.

Ok so we can rule out many issues. I've lost many hours before trying different cables 😢

What's inside the Debug Console ?

mniczyporuk commented 3 months ago

Actually, Debug Console is empty, I guess it's because debugger never starts. The Output window under "Uno Platform - Debugger" says:

[Info] dwatcher[1925]: starting for ios devices [Info] Forcing project reload to switch to net8.0-ios | Debug [Info] Starting debugging session for: Uno: net8.0-ios | Debug | ios-arm64 [Info] Ending debugging session for: Uno: net8.0-ios | Debug | ios-arm64

It looks like debugger tries to start and immediately ends.

mniczyporuk commented 3 months ago

Deployment of the app should start just after debugger starts, it looks like this steps never went to this step, as debugger fails to initiate its session.

spouliot commented 3 months ago

It should not be empty. Here's mine.

Deployment of the app should start just after debugger starts,

Not quite. It's a bit in parallel. The debugger process first install the app (line 1 of my logs) and then launch it (line 3) and, while doing so, it connects to the device (line 10).

But even if that connection fails you should see the (attempt) to deploy the app inside the Debug Console. I'm quite surprised it's empty 😞

As for the Uno Platform - Debugger then session should not end (until you stop the debugger or the process exit/crash).

[Info] Starting Debug adapter
[Info] Retrieved android devices
[Info] Forcing project reload to switch to net8.0-android | Debug
[Info] dwatcher[43849]: starting for ios devices
[Info] Forcing project reload to switch to net8.0-ios | Debug
[Info] Starting debugging session for: Uno: net8.0-ios | Debug | iossimulator-x64
[Info] Ending debugging session for: Uno: net8.0-ios | Debug | iossimulator-x64
[Info] Starting debugging session for: Uno: net8.0-ios | Debug | ios-arm64
mniczyporuk commented 3 months ago

I'm surprised too. You're right it should behaves that way as you described. When I chose simulator then is looks like you described. When I open my .NET MAUI projects, it works fine on the iOS device as well as simulator.

Do you think that this odd debugger behavior with iOS device could be related to the warning messages while building iOS target ?

ProjectName.Mobile -> /Users/marcinniczyporuk/Projects/ProjectName/ProjectName.Mobile/bin/Debug/net8.0-ios/ios-arm64/ProjectName.Mobile.dll /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1831,3): warning : The file '/Users/marcinniczyporuk/.nuget/packages/uno.extensions.hosting.winui/4.0.0/lib/net8.0-ios17.0/Uno.Extensions.Hosting.WinUI.uprimarker' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle. [/Users/marcinniczyporuk/Projects/ProjectName/ProjectName.Mobile/ProjectName.Mobile.csproj] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1831,3): warning : The file '/Users/marcinniczyporuk/.nuget/packages/uno.extensions.logging.winui/4.0.0/lib/net8.0-ios17.0/Uno.Extensions.Logging.WinUI.uprimarker' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle. [/Users/marcinniczyporuk/Projects/ProjectName/ProjectName.Mobile/ProjectName.Mobile.csproj] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1831,3): warning : The file '/Users/marcinniczyporuk/.nuget/packages/uno.fonts.fluent/2.3.0/lib/netstandard1.0/Uno.Fonts.Fluent.uprimarker' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle. [/Users/marcinniczyporuk/Projects/ProjectName/ProjectName.Mobile/ProjectName.Mobile.csproj] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1831,3): warning : The file '/Users/marcinniczyporuk/.nuget/packages/uno.fonts.roboto/2.2.2/lib/netstandard2.0/Uno.Fonts.Roboto.uprimarker' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle. [/Users/marcinniczyporuk/Projects/ProjectName/ProjectName.Mobile/ProjectName.Mobile.csproj]

mniczyporuk commented 3 months ago

Another thought is that in iOS simulator there is iOS 17.2, and in my iOS device there is iOS 17.4.

From that warning message I assume Microsoft.iOS.SDK is 17.2 version: [/Users/marcinniczyporuk/Projects/ProjectName/ProjectName.Mobile/ProjectName.Mobile.csproj] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1831,3): warning : The file '/Users/marcinniczyporuk/.nuget/packages/uno.extensions.logging.winui/4.0.0/lib/net8.0-ios17.0/Uno.Extensions.Logging.WinUI.uprimarker' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle.

Do you think that might be an issue? Note it works fine with my .NET Maui project, though.

mniczyporuk commented 3 months ago

Uno-check says all is fine with my setup:

🚑 Uno Platform Check v1.20.2.0 💉 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── This tool will check your Uno Platform development environment. If problems are detected, it will offer the option to try and fix them for you, or suggest a way to fix them yourself. ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ⏳ Synchronizing configuration... ok ⏳ Scheduling appointments... ok

🔎 OpenJDK 11.0 Checkup... ✔ 11.0.22 (/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home/bin/..)

🔎 Android SDK Checkup... ✔ emulator (33.1.24) ✔ build-tools;34.0.0 (34.0.0) ✔ platforms;android-34 (2) ✔ system-images;android-34;google_apis;arm64-v8a (12) ✔ platform-tools (34.0.5) ✔ cmdline-tools;5.0 (5.0)

🔎 Android Emulator Checkup... ✔ Emulator: Android_34 found.

🔎 XCode 15.0.1 Checkup... Command line invocation: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild

User defaults from command line: IDEPackageSupportUseBuiltinSCM = YES

2024-03-02 00:13:58.651 xcodebuild[4690:99295] Writing error result bundle to /var/folders/b7/l__bfvfd7vl7ml_w1jjx5kf00000gn/T/ResultBundle_2024-02-03_00-13-0058.xcresult xcodebuild: error: The directory /Users/marcinniczyporuk/Projects/ProjectName does not contain an Xcode project.

✔ Xcode.app (15.2 15C500b)

🔎 .NET SDK Checkup... – 6.0.418 - /usr/local/share/dotnet/sdk/6.0.418 – 6.0.419 - /usr/local/share/dotnet/sdk/6.0.419 – 7.0.312 - /usr/local/share/dotnet/sdk/7.0.312 – 7.0.313 - /usr/local/share/dotnet/sdk/7.0.313 – 8.0.101 - /usr/local/share/dotnet/sdk/8.0.101 ✔ 8.0.201 - /usr/local/share/dotnet/sdk/8.0.201

🔎 GTK3+ Checkup...

🔎 dotnet new Uno Project Templates Checkup...

🔎 .NET SDK - Workloads (8.0.201) Checkup... SHELL: /bin/zsh /var/folders/b7/l__bfvfd7vl7ml_w1jjx5kf00000gn/T/tmpYAPm1l.tmp Password:

Welcome to .NET 8.0!

SDK Version: 8.0.201

Telemetry

The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry


Installed an ASP.NET Core HTTPS development certificate. To trust the certificate, run 'dotnet dev-certs https --trust' Learn about HTTPS: https://aka.ms/dotnet-https


Write your first app: https://aka.ms/dotnet-hello-world Find out what's new: https://aka.ms/dotnet-whats-new Explore documentation: https://aka.ms/dotnet-docs Report issues and find source on GitHub: https://github.com/dotnet/core Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli

==workloadRollbackDefinitionJsonOutputStart== { "microsoft.net.sdk.android": "34.0.79/8.0.100", "microsoft.net.sdk.ios": "17.2.8022/8.0.100", "microsoft.net.sdk.maccatalyst": "17.2.8022/8.0.100", "microsoft.net.sdk.macos": "14.2.8022/8.0.100", "microsoft.net.sdk.maui": "8.0.6/8.0.100", "microsoft.net.sdk.tvos": "17.2.8022/8.0.100", "microsoft.net.workload.mono.toolchain.current": "8.0.2/8.0.100", "microsoft.net.workload.emscripten.current": "8.0.2/8.0.100", "microsoft.net.workload.emscripten.net6": "8.0.2/8.0.100", "microsoft.net.workload.emscripten.net7": "8.0.2/8.0.100", "microsoft.net.workload.mono.toolchain.net6": "8.0.2/8.0.100", "microsoft.net.workload.mono.toolchain.net7": "8.0.2/8.0.100", "microsoft.net.sdk.aspire": "8.0.0-preview.3.24105.21/8.0.100" } ==workloadRollbackDefinitionJsonOutputEnd== ✔ microsoft.net.sdk.android (34.0.79/8.0.100) installed. ✔ microsoft.net.sdk.ios (17.2.8022/8.0.100) installed. ✔ microsoft.net.sdk.maccatalyst (17.2.8022/8.0.100) installed. ✔ microsoft.net.sdk.macos (14.2.8022/8.0.100) installed. ✔ microsoft.net.sdk.maui (8.0.6/8.0.100) installed. ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

✔ Congratulations, everything looks great!

Press Enter to finish...

spouliot commented 3 months ago

That PublishFolderType warning is harmless.

iOS 17.4 is still a pre-release and newer version of iOS might require the right Xcode to be available (since it needs to download some support file to the device). OTOH it works for MAUI so it should be fine for Uno too (since it's the SDK tools that deploys the app to the device). It also does not explain the lack of any output ?!?

But, just to be sure, can you attach the output of the Debug Console when you build/deploy/debug with MAUI ?

uno-check logs looks as expected. You have Xcode 15.2 while I have 15.1 but it should not be a problem (since it works for other projects). Still I'll install 15.2 and try this again..

Also I'll look how having no Debug Console output is possible... and come up with something to try.

spouliot commented 3 months ago

Still I'll install 15.2 and try this again..

As expected this works fine (for me) when using Xcode 15.2.

Not a big surprise as any potential incompatibilities should have come after mlaunch has been called to install the app to the device.

Back to checking why nothing is logged on the Debug Console...

mniczyporuk commented 3 months ago

Still I'll install 15.2 and try this again..

As expected this works fine (for me) when using Xcode 15.2.

Not a big surprise as any potential incompatibilities should have come after mlaunch has been called to install the app to the device.

Thanks for confirming that it works for you with Xcode 15.2. On my machine, it also works well for .NET Maui (even when I deploy to an iOS device with beta 17.4 iOS version), but doesn't work with Uno app, unfortunately.

mniczyporuk commented 3 months ago

But, just to be sure, can you attach the output of the Debug Console when you build/deploy/debug with MAUI ?

Sure. I just created a new dummy .NET Maui app, and it deploys to the simulator as well as to iOS devices without any issues.

Here is the Debug Console output from the Maui app launched on the device (launched in debug mode successfully, then played with the app for few moments and I stopped the app):

The app 'com.companyname.mauiapp' launched with pid 1661 Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.iOS.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Runtime.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Collections.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Runtime.InteropServices.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Threading.Thread.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Threading.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/MauiApp1.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Private.Uri.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.Maui.Controls.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Collections.Concurrent.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.Maui.Graphics.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Numerics.Vectors.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.ObjectModel.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Xml.ReaderWriter.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Private.Xml.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Memory.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Diagnostics.TraceSource.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Collections.NonGeneric.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Collections.Specialized.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.ComponentModel.Primitives.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.ComponentModel.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Text.RegularExpressions.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Reflection.Emit.ILGeneration.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Reflection.Emit.Lightweight.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Reflection.Primitives.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Net.Primitives.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Diagnostics.Tracing.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Runtime.Intrinsics.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.Win32.Primitives.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Net.Http.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Net.Security.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Security.Cryptography.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Formats.Asn1.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Text.Encoding.Extensions.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Runtime.Numerics.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Security.Claims.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Net.Sockets.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Net.NameResolution.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Diagnostics.DiagnosticSource.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Threading.ThreadPool.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Linq.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Net.Quic.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.IO.Compression.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.IO.Compression.Brotli.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Threading.Channels.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Net.NetworkInformation.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Reflection.Emit.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Reflection.Metadata.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Collections.Immutable.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.IO.MemoryMappedFiles.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Runtime.Loader.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Linq.Expressions.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.ComponentModel.TypeConverter.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Drawing.Primitives.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Runtime.Serialization.Formatters.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Resources.Writer.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Xml.XDocument.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Private.Xml.Linq.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.Maui.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.Maui.Essentials.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.Console.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.Extensions.Logging.Abstractions.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.Extensions.DependencyInjection.Abstractions.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.Extensions.Configuration.Abstractions.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.Extensions.Primitives.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.Extensions.Configuration.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.Extensions.DependencyInjection.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.Extensions.Logging.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.Extensions.Options.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/System.ComponentModel.Annotations.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.Maui.Controls.Xaml.dll Loaded assembly: /private/var/containers/Bundle/Application/92374332-C5FB-443C-874D-8E886B7BBD89/MauiApp1.app/Microsoft.Extensions.Logging.Debug.dll Thread started: #2 2024-03-03 17:23:43.227 MauiApp1[1661:364506] You've implemented -[ application:performFetchWithCompletionHandler:], but you still need to add "fetch" to the list of your supported UIBackgroundModes in your Info.plist. Stopping iOS process... iOS Process was stopped.

spouliot commented 3 months ago

You can debug for iOS simulators so we know the debugger agent is up and running.

There is not much code in the debugger agent before it logs the command to install the app on the device. It's also almost identical to the simulator code.

The main difference is that localhost is used, for the simulator, to establish a network connection for the soft debugger.

For an iOS device we cannot use localhost (since it's not the same host) so we have to listen on all network interfaces. Is it possible that