Search code examples
c#unity-game-enginezlib

Unity Package Manager Error: zlib: incorrect data check. No packages loaded


Error when loading Image

I have now gotten this error multiple times after accessing my project on a different computer then coming back to my laptop.

I tried finding a solution online to this error but could not find anything about this specific error. I cleared the unity cache and other project settings to try and fix this issue based on similar issues.

Edit
Moved answer from the question to the posted answer.


Solution

  • After doing some tests I found that this problem can be solved fairly easily. To fix/go around this issue,

    • Go to the location of the bundled package that is listed in the error. There will be a bunch of .tgz files.
    • Copy the .tgz file that is showing in the error message (in this instance it is com.unity.adaptiveperformance-2.1.1.tgz).
    • Navigate then to: C:\Users\<username>\AppData\Local\Unity\cache\npm\packages.unity.com
    • Make a folder in this directory named without the version number and extension (folder name in this instance would be com.unity.adaptiveperformance).
    • Enter this folder and create a sub-folder with the given version number (this instance 2.1.1).
    • Paste the .tgz file that you copied before into this folder and rename it package.tgz.
    • Open the .tgz file or extract the file to the version number folder you created. Image of final directory path and files

    My understanding of this problem is that after syncing data between my main computer and my laptop made it to where the package data would be regenerated on my laptop. When this occurred, my laptop would not be able to extract a given package from unity's compressed packages for the editor. This caused me to have to manually extract that given package into the unity cache. (Note: syncing was done through onedrive)

    After you have added the file, close and relaunch the unity project and it should pass this error without issue. I thought I should post this issue and the solution I found for others that may find themselves with this same issue.