[Bug] VS2022 Preview 4 won't create working MAUI apps
See original GitHub issueDescription
When I create a new MAUI app, I get the following
Error XA1018 Specified AndroidManifest file does not exist: C:\Users\x\source\repos\MauiApp9\MauiApp9\MauiApp9\AndroidManifest.xml. MauiApp9 C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.100-rc.1.12\tools\Xamarin.Android.Common.targets 509
Error NU1012 Platform version is not present for one or more target frameworks, even though they have specified a platform: net6.0-ios, net6.0-maccatalyst MauiApp9 C:\Users\x\source\repos\MauiApp9\MauiApp9\MauiApp9\MauiApp9.csproj 1
Error NU1012 Platform version is not present for one or more target frameworks, even though they have specified a platform: net6.0-ios, net6.0-maccatalyst MauiApp9 C:\Users\x\source\repos\MauiApp9\MauiApp9\MauiApp9\MauiApp9.csproj 1
Error NU1012 Platform version is not present for one or more target frameworks, even though they have specified a platform: net6.0-ios, net6.0-maccatalyst MauiApp9 C:\Users\x\source\repos\MauiApp9\MauiApp9\MauiApp9\MauiApp9.csproj 1
Warning MSB3779 The processor architecture of the project being built "Any CPU" is not supported by the referenced SDK "Microsoft.VCLibs.Desktop, Version=14.0". Please consider changing the targeted processor architecture of your project (in Visual Studio this can be done through the Configuration Manager) to one of the architectures supported by the SDK: "x86, x64, ARM, ARM64". MauiApp9.WinUI C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 2586
Warning MSB3779 The processor architecture of the project being built "Any CPU" is not supported by the referenced SDK "Microsoft.UniversalCRT.Debug, Version=10.0.19041.0". Please consider changing the targeted processor architecture of your project (in Visual Studio this can be done through the Configuration Manager) to one of the architectures supported by the SDK: "x86, x64, ARM, ARM64". MauiApp9.WinUI C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 2586
Warning MSB3779 The processor architecture of the project being built "Any CPU" is not supported by the referenced SDK "Microsoft.VCLibs, Version=14.0". Please consider changing the targeted processor architecture of your project (in Visual Studio this can be done through the Configuration Manager) to one of the architectures supported by the SDK: "x86, x64, ARM, ARM64". MauiApp9.WinUI C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 2586
Other info
I tried MAUI-CHECK, which gave the following output
PS C:\WINDOWS\system32> maui-check
_ _ _____ _____ __ __ _ _ _ ___
| \ | | | ____| |_ _| | \/ | / \ | | | | |_ _|
| \| | | _| | | | |\/| | / _ \ | | | | | |
_ | |\ | | |___ | | | | | | / ___ \ | |_| | | |
(_) |_| \_| |_____| |_| |_| |_| /_/ \_\ \___/ |___|
Β€ .NET MAUI Check v0.8.6.0 Β€
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
This tool will attempt to evaluate your .NET MAUI development environment.
If problems are detected, this tool may offer the option to try and fix them for you, or suggest a way to fix them
yourself.
Thanks for choosing .NET MAUI!
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Β» Synchronizing configuration... ok
Β» Scheduling appointments... ok
> OpenJDK 11.0 Checkup...
- 11.0.12 (C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin\..)
- 1.8.0-25 (C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25)
- 11.0.10 (C:\Program Files\Microsoft\jdk-11.0.10.9-hotspot\bin\..)
- 15 (C:\Program Files\Common Files\Oracle\Java)
> Visual Studio 17.0.0-pre.4.0 Checkup...
- 16.10.4
- 16.11.2
- 17.0.0-pre.4.0 - C:\Program Files\Microsoft Visual Studio\2022\Preview
> Android SDK Checkup...
- emulator (30.8.4)
- build-tools;31.0.0 (31.0.0)
- platforms;android-31 (1)
- system-images;android-31;google_apis;x86_64 (8)
- platform-tools (31.0.3)
- cmdline-tools;3.0 (3.0)
> Android Emulator Checkup...
- Emulator: pixel_2_pie_9_0_-_api_28 found.
> .NET SDK Checkup...
- 3.1.413 - C:\Program Files\dotnet\sdk\3.1.413
- 5.0.104 - C:\Program Files\dotnet\sdk\5.0.104
- 5.0.207 - C:\Program Files\dotnet\sdk\5.0.207
- 5.0.302 - C:\Program Files\dotnet\sdk\5.0.302
- 5.0.303 - C:\Program Files\dotnet\sdk\5.0.303
- 5.0.400 - C:\Program Files\dotnet\sdk\5.0.400
- 6.0.100-rc.1.21458.32 - C:\Program Files\dotnet\sdk\6.0.100-rc.1.21458.32
> .NET SDK - Workload Deduplication Checkup...
> Edge WebView2 Checkup...
- Found Edge WebView2 version 93.0.961.47
> .NET SDK - Workloads (6.0.100-rc.1.21458.32) Checkup...
- android-aot (Microsoft.NET.Sdk.Android.Manifest-6.0.100 : 31.0.100-rc.1.12) installed.
Γ ios (Microsoft.NET.Sdk.iOS.Manifest-6.0.100 : 15.0.100-rc.1.1534) not installed.
Γ maccatalyst (Microsoft.NET.Sdk.MacCatalyst.Manifest-6.0.100 : 15.0.100-rc.1.1534) not installed.
- tvos (Microsoft.NET.Sdk.tvOS.Manifest-6.0.100 : 15.0.100-rc.1.1534) installed.
- macos (Microsoft.NET.Sdk.macOS.Manifest-6.0.100 : 12.0.100-rc.1.1534) installed.
Γ maui (Microsoft.NET.Sdk.Maui.Manifest-6.0.100 : 6.0.100-rc.1.1608) not installed.
- wasm-tools (microsoft.net.workload.mono.toolchain.manifest-6.0.100 : 6.0.0-rc.1.21451.13) installed.
- microsoft-net-sdk-emscripten (microsoft.net.workload.emscripten.manifest-6.0.100 : 6.0.0-rc.1.21430.3) installed.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Β€ Recommendation: Install or Update SDK Workloads
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
! Attempt to fix? [y/n] (y):
Attempting to fix gave the following output (with errors)
Β» Attempting to fix: .NET SDK - Workloads (6.0.100-rc.1.21458.32)
SHELL: C:\Program Files\dotnet\dotnet.exe workload update --no-cache --disable-parallel --from-rollback-file "C:\Users\x\AppData\Local\Temp\maui-check-321a8d4d\workload.json" --source "https://api.nuget.org/v3/index.json" --source "https://pkgs.dev.azure.com/dnceng/public/_packaging/6.0.100-rc.1.21458.32-shipping/nuget/v3/index.json"
Updated advertising manifest microsoft.net.sdk.android.
Updated advertising manifest microsoft.net.sdk.ios.
Updated advertising manifest microsoft.net.sdk.maccatalyst.
Updated advertising manifest microsoft.net.sdk.macos.
Updated advertising manifest microsoft.net.sdk.maui.
Updated advertising manifest microsoft.net.sdk.tvos.
Updated advertising manifest microsoft.net.workload.emscripten.
Updated advertising manifest microsoft.net.workload.mono.toolchain.
Successfully updated workload(s): android-aot macos tvos wasm-tools.
SHELL: C:\Program Files\dotnet\dotnet.exe workload install --no-cache --disable-parallel android-aot ios maccatalyst tvos macos maui wasm-tools --skip-manifest-update --source "https://api.nuget.org/v3/index.json" --source "https://pkgs.dev.azure.com/dnceng/public/_packaging/6.0.100-rc.1.21458.32-shipping/nuget/v3/index.json"
Downloading Microsoft.iOS.Sdk.Msi.x64 (15.0.100-rc.1.1531)
Downloading Microsoft.iOS.Sdk.Msi.x64 (15.0.100-rc.1.1531)
Workload installation failed. Rolling back installed packs...
Downloading Microsoft.iOS.Sdk.Msi.x64 (15.0.100-rc.1.1531)
Installation rollback failed: One or more errors occurred. (microsoft.ios.sdk.msi.x64::15.0.100-rc.1.1531 is not found in NuGet feeds https://api.nuget.org/v3/index.json;https://pkgs.dev.azure.com/dnceng/public/_packaging/6.0.100-rc.1.21458.32-shipping/nuget/v3/index.json".)
Workload installation failed: One or more errors occurred. (microsoft.ios.sdk.msi.x64::15.0.100-rc.1.1531 is not found in NuGet feeds https://api.nuget.org/v3/index.json;https://pkgs.dev.azure.com/dnceng/public/_packaging/6.0.100-rc.1.21458.32-shipping/nuget/v3/index.json".)
Description:
Install one or more workloads.
Usage:
dotnet [options] workload install [<WORKLOAD_ID>...]
Arguments:
<WORKLOAD_ID> The NuGet package ID of the workload to install.
Options:
--sdk-version <VERSION> The version of the SDK.
--configfile <FILE> The NuGet configuration file to use.
-s, --source <SOURCE> The NuGet package source to use during the restore. To specify multiple sources, repeat the option.
--skip-manifest-update Skip updating the workload manifests.
--from-cache <from-cache> Complete the operation from cache (offline).
--download-to-cache <download-to-cache> Download packages needed to install a workload to a folder that can be used for offline installation.
--include-previews Allow prerelease workload manifests.
--temp-dir <temp-dir> Specify a temporary directory for this command to download and extract NuGet packages (must be secure).
--disable-parallel Prevent restoring multiple projects in parallel.
--ignore-failed-sources Treat package source failures as warnings.
--no-cache Do not cache packages and http requests.
--interactive Allows the command to stop and wait for user input or action (for example to complete authentication).
-v, --verbosity <LEVEL> Set the MSBuild verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].
-?, -h, --help Show command line help.
Fix failed - Workload Install failed: `dotnet workload install --no-cache --disable-parallel android-aot ios maccatalyst
tvos macos maui wasm-tools --skip-manifest-update --source "https://api.nuget.org/v3/index.json" --source
"https://pkgs.dev.azure.com/dnceng/public/_packaging/6.0.100-rc.1.21458.32-shipping/nuget/v3/index.json"`
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
! There were one or more problems detected.
Please review the errors and correct them and run maui-check again.
Press enter to exit...
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:21 (6 by maintainers)
Top Results From Across the Web
Troubleshoot known issues - .NET MAUI
NET Multi-platform App UI (.NET MAUI), and how you can solve or work around them. The .NET MAUI repository also details some known...
Read more >Why can't I compile a .NET MAUI app on Visual Studio 2022?
1.1 Close Visual Studio and make sure devenv process is not present in Task Manager ( Details tab).
Read more >Cannot debug net6.0-macos Apps - Developer Community
I've installed the preview today, created a new project for testing. A prompt popped up requesting to control other apps, which I accepted...
Read more >Did .NET MAUI Ship Too Soon? Devs Sound Off on ' ...
I've worked deeply on an app using MAUI, The VS IDE itself has bugs with MAUI too. The devs working so fast on...
Read more >Building cross platform apps with .NET MAUI in Visual Studio ...
In this talk we'll take a look at Visual Studio 17.1 Preview and the new capabilities for developers building cross platform apps with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks James. I am not sure what happened. But I had to install Xamarin Workload in VS 2019 and I created an emulator there. I then came to VS 2022 and was able to run it.
@DevCisse make sure to install JDK 11 and make sure it is set properly -> https://docs.microsoft.com/en-us/dotnet/maui/get-started/installation#android