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.

Workload installation fails with "Number of entries expected in End Of Central Directory does not correspond to number of entries in Central Directory"

See original GitHub issue

Description

Can’t install Maui workload on macOS Monterey (12.1) on Apple Silicon ARM64 with sudo dotnet workload install maui or subset of maui, like maui-ios.

I am getting the following error, every single time:

Workload installation failed: 
Number of entries expected in End Of Central Directory 
does not correspond to number of entries in Central Directory.

All prerequisites are installed according to official install instructions. Fresh install of latest .NET 6 SDK 6.0.101. maui-check is checking out without problems.

Steps to Reproduce

Run sudo dotnet workload install maui in CLI.

Version with bug

Preview 11

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

macOS 12.1

Did you find any workaround?

I found a workaround encountering download issues with the dotnet workload install command. This involves some helpful, but unfortunately undocumented, command options I figured out by looking into the source code in the .NET SDK GitHub repo. 😮‍💨

⚠️ Attention
This requires a \*nix shell environment. You can probably get this working in Powershell as well.

🗒 Note
The following commands use sources specifically for installation of MAUI Preview 12.
If you want to use stable workloads the same instructions should apply but without the 
need for the rollback file or sources.

Download URLS

First you have to download the URLs to the needed workload nuget packages.

# Get all URLS
dotnet workload install maui \
    --print-download-link-only \
    --skip-manifest-update \
    --from-rollback-file https://aka.ms/dotnet/maui/preview.12.json \
    --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json \
    --source https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json
# Example Output
Resolving package URLs for workload(s) maui...
	==allPackageLinksJsonOutputStart==
["https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/825db618-e3eb-4426-ba54-b1d6e6c944d8/nuget/v3/flat2/microsoft.netcore.app.runtime.mono.android-arm/6.0.2-mauipre.1.22054.8/microsoft.netcore.app.runtime.mono.android-arm.6.0.2-mauipre.1.22054.8.nupkg",
 ... ]
==allPackageLinksJsonOutputEnd==

Create list of URLs

Then you follow the next steps to create a file with all links, ready to be used with wget.

  1. Paste package links JSON into a new text file, e.g. maui.workload.preview-12.txt.
  2. Replace all , with newline, remove [, ] and ".
  3. Create new folder, e.g. maui.nuget.cache.
  4. Change into new folder.

Download packages

Use wget command inside of new cache folder to download all packages from text file.

wget -nv --show-progress -nc -c -i maui.workload.preview-12.txt

You can retry as often as needed, use ctrl-c to cancel when the download gets stuck and use the command again to continue where the download stopped. wget will skip files you already downloaded.

Install workload from disk

Now use the downloaded files from your local cache to install the workload.

sudo dotnet workload install maui \
    --from-cache ~/path/to/maui.nuget.cache \
    --skip-manifest-update \
    --from-rollback-file https://aka.ms/dotnet/maui/preview.12.json \
    --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json \
    --source https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json

Use the same sources to restore a project

dotnet restore \
    --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json \
    --source https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json

That should do it.



Relevant log output

➜ sudo dotnet workload install maui

Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.101

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' (Windows and macOS only).
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
--------------------------------------------------------------------------------------

Skip NuGet package signing validation. NuGet signing validation is not available on Linux or macOS https://aka.ms/workloadskippackagevalidation .
Updated advertising manifest microsoft.net.sdk.ios.
Updated advertising manifest microsoft.net.sdk.tvos.
Updated advertising manifest microsoft.net.sdk.android.
Updated advertising manifest microsoft.net.workload.emscripten.
Updated advertising manifest microsoft.net.sdk.maui.
Updated advertising manifest microsoft.net.sdk.macos.
Updated advertising manifest microsoft.net.sdk.maccatalyst.
Updated advertising manifest microsoft.net.workload.mono.toolchain.
Installing workload manifest microsoft.net.sdk.tvos version 15.0.101-preview.11.551…
Installing workload manifest microsoft.net.sdk.android version 31.0.101-preview.11.117…
Installing workload manifest microsoft.net.sdk.maui version 6.0.101-preview.11.2349…
Installing workload manifest microsoft.net.sdk.macos version 12.0.101-preview.11.551…
Installing workload manifest microsoft.net.sdk.maccatalyst version 15.0.101-preview.11.551…
Installing workload manifest microsoft.net.sdk.ios version 15.0.101-preview.11.551…
Installing pack Microsoft.Maui.Core.Ref.android version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Core.Ref.android version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Core.Runtime.android version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Core.Runtime.android version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Controls.Ref.android version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Controls.Ref.android version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Controls.Runtime.android version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Controls.Runtime.android version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Essentials.Ref.android version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Essentials.Ref.android version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Essentials.Runtime.android version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Essentials.Runtime.android version 6.0.101-preview.11.2349...
Installing pack Microsoft.AspNetCore.Components.WebView.Maui version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.AspNetCore.Components.WebView.Maui version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Dependencies version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Dependencies version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Controls.Build.Tasks version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Controls.Build.Tasks version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Sdk version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Sdk version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Extensions version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Extensions version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Resizetizer.Sdk version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Resizetizer.Sdk version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Templates version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Templates version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Core.Ref.any version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Core.Ref.any version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Core.Runtime.any version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Core.Runtime.any version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Controls.Ref.any version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Controls.Ref.any version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Controls.Runtime.any version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Controls.Runtime.any version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Essentials.Ref.any version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Essentials.Ref.any version 6.0.101-preview.11.2349...
Installing pack Microsoft.Maui.Essentials.Runtime.any version 6.0.101-preview.11.2349...
Writing workload pack installation record for Microsoft.Maui.Essentials.Runtime.any version 6.0.101-preview.11.2349...
Installing pack Microsoft.Android.Sdk version 31.0.101-preview.11.117...
Writing workload pack installation record for Microsoft.Android.Sdk version 31.0.101-preview.11.117...
Installing pack Microsoft.Android.Sdk.BundleTool version 31.0.101-preview.11.117...
Writing workload pack installation record for Microsoft.Android.Sdk.BundleTool version 31.0.101-preview.11.117...
Installing pack Microsoft.Android.Ref.31 version 31.0.101-preview.11.117...
Writing workload pack installation record for Microsoft.Android.Ref.31 version 31.0.101-preview.11.117...
Installing pack Microsoft.Android.Runtime.31.android-arm version 31.0.101-preview.11.117...
Workload installation failed. Rolling back installed packs...
Installing workload manifest microsoft.net.sdk.tvos version 15.0.101-preview.9.31…
Installation rollback failed: Failed to install manifest microsoft.net.sdk.tvos version 15.0.101-preview.9.31: The transaction has aborted..
Rolling back pack Microsoft.Maui.Core.Ref.android installation...
Uninstalling workload pack Microsoft.Maui.Core.Ref.android version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Core.Runtime.android installation...
Uninstalling workload pack Microsoft.Maui.Core.Runtime.android version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Controls.Ref.android installation...
Uninstalling workload pack Microsoft.Maui.Controls.Ref.android version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Controls.Runtime.android installation...
Uninstalling workload pack Microsoft.Maui.Controls.Runtime.android version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Essentials.Ref.android installation...
Uninstalling workload pack Microsoft.Maui.Essentials.Ref.android version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Essentials.Runtime.android installation...
Uninstalling workload pack Microsoft.Maui.Essentials.Runtime.android version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.AspNetCore.Components.WebView.Maui installation...
Uninstalling workload pack Microsoft.AspNetCore.Components.WebView.Maui version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Dependencies installation...
Uninstalling workload pack Microsoft.Maui.Dependencies version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Controls.Build.Tasks installation...
Uninstalling workload pack Microsoft.Maui.Controls.Build.Tasks version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Sdk installation...
Uninstalling workload pack Microsoft.Maui.Sdk version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Extensions installation...
Uninstalling workload pack Microsoft.Maui.Extensions version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Resizetizer.Sdk installation...
Uninstalling workload pack Microsoft.Maui.Resizetizer.Sdk version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Templates installation...
Uninstalling workload pack Microsoft.Maui.Templates version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Core.Ref.any installation...
Uninstalling workload pack Microsoft.Maui.Core.Ref.any version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Core.Runtime.any installation...
Uninstalling workload pack Microsoft.Maui.Core.Runtime.any version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Controls.Ref.any installation...
Uninstalling workload pack Microsoft.Maui.Controls.Ref.any version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Controls.Runtime.any installation...
Uninstalling workload pack Microsoft.Maui.Controls.Runtime.any version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Essentials.Ref.any installation...
Uninstalling workload pack Microsoft.Maui.Essentials.Ref.any version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Maui.Essentials.Runtime.any installation...
Uninstalling workload pack Microsoft.Maui.Essentials.Runtime.any version 6.0.101-preview.11.2349…
Rolling back pack Microsoft.Android.Sdk installation...
Uninstalling workload pack Microsoft.Android.Sdk version 31.0.101-preview.11.117…
Rolling back pack Microsoft.Android.Sdk.BundleTool installation...
Uninstalling workload pack Microsoft.Android.Sdk.BundleTool version 31.0.101-preview.11.117…
Rolling back pack Microsoft.Android.Ref.31 installation...
Uninstalling workload pack Microsoft.Android.Ref.31 version 31.0.101-preview.11.117…
Rolling back pack Microsoft.Android.Runtime.31.android-arm installation...
Workload installation failed: Number of entries expected in End Of Central Directory does not correspond to number of entries in Central Directory.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Redthcommented, Jan 22, 2022

Please add your findings to the issue in their repo. I’m not familiar with their code base but I can raise the issue again with the team if you’ve shared new/more info.

Thanks!

0reactions
philippjbauercommented, Jan 22, 2022

@Redth I found a workaround for this and added it to the OP. Do you think this could find a place over in the SDK issue you linked to help people with similar download issues that discover that thread?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Number of entries expected in End Of Central Directory ...
The issue we're having is that further down the chain if we create a new ZipArchive using fileBytes we get the error: Number...
Read more >
Announcing .NET MAUI Preview 6
NET MAUI Preview 6 is now available with workload installation, ... in End Of Central Directory does not correspond to number of entries...
Read more >
System.IO.InvalidDataException: 'End of Central Directory ...
Basically, I have a program that reads a .ZIP file then saves it back to the hard disc. Although C# crashes with the...
Read more >
Getting End of Central Directory Signature Not Found error ...
I had to install it a few times myself, the transfer kept downloading a file which was too small. Also you must install...
Read more >
How to Fix Unzip Error “End-of-central-directory signature ...
Rarely, you may attempt to unzip a zip archive and come across an error that states “End-of-central-directory signature not found.
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