dotnet-maui-check icon indicating copy to clipboard operation
dotnet-maui-check copied to clipboard

[BUG] Workload installation failed: The JSON value could not be converted to

Open davidbuckleyni opened this issue 3 years ago • 21 comments

Issue with IOS work load on windows 10

More specificially this line

Garbage collecting for SDK feature bands 6.0.100... Workload installation failed: The JSON value could not be converted to Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackId. Path: $.Id | LineNumber: 0 | BytePositionInLine: 29.

Updated advertising manifest microsoft.net.workload.emscripten. Updated advertising manifest microsoft.net.sdk.maccatalyst. Updated advertising manifest microsoft.net.sdk.tvos. Updated advertising manifest microsoft.net.sdk.ios. Installing workload manifest microsoft.net.sdk.ios version 15.0.100-preview.7231. Installing workload manifest microsoft.net.sdk.maccatalyst version 15.0.100-preview.7231. Installing workload manifest microsoft.net.sdk.macos version 12.0.100-preview.7231. Installing workload manifest microsoft.net.sdk.tvos version 15.0.100-preview.7231. Installing pack Microsoft.iOS.Sdk version 15.0.100-preview.7.230... Writing workload pack installation record for Microsoft.iOS.Sdk version 15.0.100-preview.7.230... Installing pack Microsoft.iOS.Windows.Sdk version 15.0.100-preview.7.230... Writing workload pack installation record for Microsoft.iOS.Windows.Sdk version 15.0.100-preview.7.230... Installing pack Microsoft.iOS.Ref version 15.0.100-preview.7.230... Writing workload pack installation record for Microsoft.iOS.Ref version 15.0.100-preview.7.230... Installing pack Microsoft.iOS.Templates version 15.0.100-preview.7.230... Writing workload pack installation record for Microsoft.iOS.Templates version 15.0.100-preview.7.230... Installing pack Microsoft.Android.Sdk version 30.0.100-preview.7.110... Writing workload pack installation record for Microsoft.Android.Sdk version 30.0.100-preview.7.110... Installing pack Microsoft.Android.Sdk.BundleTool version 30.0.100-preview.7.110... Writing workload pack installation record for Microsoft.Android.Sdk.BundleTool version 30.0.100-preview.7.110... Installing pack Microsoft.Android.Ref version 30.0.100-preview.7.110... Writing workload pack installation record for Microsoft.Android.Ref version 30.0.100-preview.7.110... Installing pack Microsoft.Android.Templates version 30.0.100-preview.7.110... Writing workload pack installation record for Microsoft.Android.Templates version 30.0.100-preview.7.110... Installing pack Microsoft.MacCatalyst.Sdk version 15.0.100-preview.7.230... Writing workload pack installation record for Microsoft.MacCatalyst.Sdk version 15.0.100-preview.7.230... Installing pack Microsoft.MacCatalyst.Ref version 15.0.100-preview.7.230... Writing workload pack installation record for Microsoft.MacCatalyst.Ref version 15.0.100-preview.7.230... Installing pack Microsoft.MacCatalyst.Templates version 15.0.100-preview.7.230... Writing workload pack installation record for Microsoft.MacCatalyst.Templates version 15.0.100-preview.7.230... Garbage collecting for SDK feature bands 6.0.100... Workload installation failed: The JSON value could not be converted to Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackId. Path: $.Id | LineNumber: 0 | BytePositionInLine: 29.

davidbuckleyni avatar Aug 12 '21 20:08 davidbuckleyni

Hey

I'm getting a very similar issue.

Trying to upgrade from preview 6 and have already installed maui-check 7.3.0.

image

I've already updated to VS 2022 Preview 3 and running maui-check results in it trying to repair the workload installation for maui.

image

My error is very similar to @davidbuckleyni's:

Workload repair failed: The JSON value could not be converted to Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackId. Path: $.Id | LineNumber: 0 | BytePositionInLine: 40.

Installation continues but results in the following:

Fix failed - Workload Update failed: `dotnet workload update --sdk-version 6.0.100-preview.7.21379.14 --no-cache --disable-parallel --from-rollback-file
"C:\Users\Paul\AppData\Local\Temp\maui-check-dotnet-work-dir\workload.json" --source "https://api.nuget.org/v3/index.json" --source
"https://pkgs.dev.azure.com/dnceng/public/_packaging/6.0.100-preview.7.21379.14-shipping-1/nuget/v3/index.json"`

image

This attempt was using the --force-dotnet switch. I had a previous failure where the configured NuGet package wasn't available in the source:

Installing pack Microsoft.Maui.Core.Ref.android version 6.0.100-preview.7.1063+sha.f5acc965e-azdo.5006556...
Rolling back pack Microsoft.Maui.Core.Ref.android installation...
Workload repair failed: microsoft.maui.core.ref.android::6.0.100-preview.7.1063 is not found in NuGet feeds https://api.nuget.org/v3/index.json;https://pkgs.dev.azure.com/dnceng/public/_packaging/6.0.100-preview.7.21379.14-shipping-1/nuget/v3/index.json".

I can see that the current version of the 'missing' package is "Microsoft.Maui.Core.Ref.android -Version 6.0.100-preview.7.1345" from three days ago when preview 7 was released.

PaulSorauer-IPG avatar Aug 13 '21 08:08 PaulSorauer-IPG

Upon further investigation this doesn't appear to be a maui-check issue. Trying to install the maui workloads manually using dotnet workload install maui results in the same error:

Workload installation failed: The JSON value could not be converted to Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackId. Path: $.Id | LineNumber: 0 | BytePositionInLine: 52.

PaulSorauer-IPG avatar Aug 13 '21 08:08 PaulSorauer-IPG

Aaaaaaaaaaaaaaaaaaaaaaaaad.......

In more recent developments, it appears that there was a manifest change a while ago in some of the json configs, so this issue is likely to occur when you have previously had Preview 6 installed.

The recommended fix is to manually delete everything under "C:\Program Files\dotnet\metadata\workloads" and then install the workloads manually followed by another run at maui-check:

dotnet workload install maui

then

maui-check

Worked for me:

image

PaulSorauer-IPG avatar Aug 13 '21 08:08 PaulSorauer-IPG

@Redth might be one for u to look above as to a fix for future releases

davidbuckleyni avatar Aug 13 '21 11:08 davidbuckleyni

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

Aaaaaaaaaaaaaaaaaaaaaaaaad.......

In more recent developments, it appears that there was a manifest change a while ago in some of the json configs, so this issue is likely to occur when you have previously had Preview 6 installed.

The recommended fix is to manually delete everything under "C:\Program Files\dotnet\metadata\workloads" and then install the workloads manually followed by another run at maui-check:

dotnet workload install maui

then

maui-check

Worked for me:

image

Probally still be worth redth checking the json change and asking users to delete workloads to update?

davidbuckleyni avatar Aug 13 '21 11:08 davidbuckleyni

Upon further investigation this doesn't appear to be a maui-check issue. Trying to install the maui workloads manually using dotnet workload install maui results in the same error:

Workload installation failed: The JSON value could not be converted to Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackId. Path: $.Id | LineNumber: 0 | BytePositionInLine: 52.

dotnet tool update -g redth.net.maui.check

should do the trick (had the same problem)

PatrizioR avatar Aug 15 '21 07:08 PatrizioR

I also had an older preview of 6.0 installed and encountered the same errors with both maui-check and the dotnet workload install maui commands.

+1 on the fix, https://github.com/Redth/dotnet-maui-check/issues/105#issuecomment-898295227

johncclayton avatar Aug 15 '21 15:08 johncclayton

This helped me to install preview7 after having installed preview6:

dotnet workload install maui -v d --ignore-failed-sources --disable-parallel --temp-dir="C:\maui-temp"

MartyIX avatar Aug 17 '21 10:08 MartyIX

@Redth buddy u could easily add remove preview versions before installing maybe would be a good option are u accepting pull request into the product.

davidbuckleyni avatar Aug 17 '21 18:08 davidbuckleyni

I still get this with Tool 'redth.net.maui.check' was reinstalled with the latest stable version (version '0.8.4').

Workload installation failed: One or more errors occurred. (microsoft.maui.core.ref.android.msi.x64::6.0.100-rc.1.1351 is not found in NuGet feeds https://api.nuget.org/v3/index.json;C:\Program Files (x86)\Microsoft SDKs\NuGetPackages".)

maui-check --preview did the trick and installed all req workloads

cheles avatar Sep 06 '21 07:09 cheles

The recommended fix is to manually delete everything under "C:\Program Files\dotnet\metadata\workloads" and then install the workloads manually followed by another run at maui-check:

Where are the workloads installed on macos?

arivoir avatar Sep 10 '21 19:09 arivoir

FYI I found it here /usr/local/share/dotnet/metadata/workloads

arivoir avatar Sep 10 '21 19:09 arivoir

Another thing that makes me upset about this tool is that if you say are using the rc.2 .NET SDK and do the steps above to properly install the RC.2 versions of MAUI, this tool then forces the uninstall of the RC.2 versions for the preview 7 ones which makes me mad because I want to keep those versions and use it with Visual Studio.

Honestly I think the tool should check for Preview 7 (or newer) and if they have a version newer than Preview 7 installed (like rc.1 or rc.2) to use that to install maui (or the templates to maui) on.

AraHaan avatar Sep 13 '21 13:09 AraHaan

This helped me. I wanted to add my symptoms:

Messing around and updating from VS2022 Preview 3 to Preview 4, MAUI templates were missing when I went to create a new project. I tried maui-check (which Microsoft says is not necessary), but that would error on workloads: maui, maui-ios, maui-android, maui-catalyst. I would see this error: image

drinck avatar Sep 20 '21 21:09 drinck

Same here

sencagri avatar Sep 24 '21 13:09 sencagri

That's work for me if I want to use the maui preview8.

  1. Clean the history data use this script: https://github.com/Redth/dotnet-maui-check/blob/main/Clean-Old-DotNet6-Previews.ps1

2.Delete the maui-check tool: dotnet tool uninstall -g Redth.Net.Maui.Check

3.Uninstall VS2012 Preview4

4.Reinstall VS2012 Preview4

5.Reinstall maui-check tool: dotnet tool install -g Redth.Net.Maui.Check

6.Do check script: maui-check

jingliancui avatar Sep 24 '21 14:09 jingliancui

Just run this script https://github.com/Redth/dotnet-maui-check/blob/main/Clean-Old-DotNet6-Previews.ps1 then dotnet tool update -g Redth.Net.Maui.Check then maui-check

uzairali001 avatar Sep 25 '21 13:09 uzairali001

That's work for me if I want to use the maui preview8.

  1. Clean the history data use this script:

https://github.com/Redth/dotnet-maui-check/blob/main/Clean-Old-DotNet6-Previews.ps1

2.Delete the maui-check tool:

dotnet tool uninstall -g Redth.Net.Maui.Check

3.Uninstall VS2012 Preview4

4.Reinstall VS2012 Preview4

5.Reinstall maui-check tool:

dotnet tool install -g Redth.Net.Maui.Check

6.Do check script:

maui-check

These should be steps done by maui check user should not need to do all this @Redth

davidbuckleyni avatar Oct 09 '21 10:10 davidbuckleyni

Aaaaaaaaaaaaaaaaaaaaaaaaad.......

In more recent developments, it appears that there was a manifest change a while ago in some of the json configs, so this issue is likely to occur when you have previously had Preview 6 installed.

The recommended fix is to manually delete everything under "C:\Program Files\dotnet\metadata\workloads" and then install the workloads manually followed by another run at maui-check:

dotnet workload install maui

then

maui-check

Worked for me:

image

Fixed my issue.

slodhi786 avatar Oct 13 '21 23:10 slodhi786

Seems to be still an issue here


» Synchronizing configuration... ok
» Scheduling appointments... ok

> OpenJDK 11.0 Checkup...
  - 11.0.12 (C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin\..)

> Visual Studio 17.1.0-pre.3.0 Checkup...
  - 17.3.0-pre.1.0 - C:\Program Files\Microsoft Visual Studio\2022\Preview
  - 17.1.6 - C:\Program Files\Microsoft Visual Studio\2022\Community

> Android SDK Checkup...

x Skipped: Android Emulator

> .NET SDK Checkup...
  - 6.0.202 - C:\Program Files\dotnet\sdk\6.0.202
  - 6.0.300-preview.22204.3 - C:\Program Files\dotnet\sdk\6.0.300-preview.22204.3
  - 6.0.300 - C:\Program Files\dotnet\sdk\6.0.300

> .NET SDK - Workload Deduplication Checkup...

> Edge WebView2 Checkup...
  - Found Edge WebView2 version 101.0.1210.39

> .NET SDK - Workloads (6.0.200) Checkup...
  x android-aot (Microsoft.NET.Sdk.Android.Manifest-6.0.200 : 31.0.200-preview.12.2) not installed.
  x ios (Microsoft.NET.Sdk.iOS.Manifest-6.0.200 : 15.2.200-preview.12.4) not installed.
  x maccatalyst (Microsoft.NET.Sdk.MacCatalyst.Manifest-6.0.200 : 15.2.200-preview.12.4) not installed.
  x tvos (Microsoft.NET.Sdk.tvOS.Manifest-6.0.200 : 15.2.200-preview.12.4) not installed.
  x macos (Microsoft.NET.Sdk.macOS.Manifest-6.0.200 : 12.1.200-preview.12.4) not installed.
  x maui (Microsoft.NET.Sdk.Maui.Manifest-6.0.200 : 6.0.200-preview.12.2441) not installed.
! Managing Workload installation from the CLI is NOT recommended.  Instead you should install the latest Visual Studio
preview to automatically get the newest release of .NET MAUI workloads installed.
Are you sure you would like to continue the CLI workload installation? [y/n] (n): y

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 Recommendation: Install or Update SDK Workloads
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

! Attempt to fix? [y/n] (y): y
» Attempting to fix: .NET SDK - Workloads (6.0.200)
SHELL: C:\Program Files\dotnet\dotnet.exe workload install --from-rollback-file "C:\Users\David\AppData\Local\Temp\maui-check-3002800c\workload.json" android-aot ios maccatalyst tvos macos maui --source "https://api.nuget.org/v3/index.json"
Workload ID android-aot is not recognized.
Fix failed - Workload Install failed: `dotnet workload install --from-rollback-file
"C:\Users\David\AppData\Local\Temp\maui-check-3002800c\workload.json" android-aot ios maccatalyst tvos macos maui
--source "https://api.nuget.org/v3/index.json"`
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────


! There were one or more problems detected.
Please review the errors and correct them and run maui-check again.

davidbuckleyni avatar May 10 '22 22:05 davidbuckleyni

Please, check these links. I had the same issue. Following these instructions, it worked here. https://github.com/dotnet/maui/blob/main/.github/DEVELOPMENT.md#net-maui-workload https://stackoverflow.com/questions/68746577/workload-repair-failed-dotnet-workload-repair-maui

maroquio avatar Jun 11 '22 14:06 maroquio