Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Packages inside package folder empty

Discussion in 'Package Manager' started by hawaiian_lasagne, Jul 16, 2018.

  1. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    120
    Hi

    I am getting a bunch of build errors related to missing source files from various packages (textmeshpro/package-manager-ui/standard-events) after upgrading to unity 2018.2

    It seems the packages are correctly downloaded to the unity cache, but no files are copied across to Packages folder inside the project. The entire folder structure is there though.. just no files.

    Copying the packages across from the cache and manually renaming them makes the issue go away,

    Any idea what is causing this?
     
    Binco97 and Gizambica like this.
  2. GarethIW

    GarethIW

    Joined:
    Jun 24, 2014
    Posts:
    50
    Seeing this too. Causes build errors in VS due to all the missing scripts, although i can still attach the debugger after ignoring the build failure error. Also causes compilation errors in any upgraded projects that use TextMeshPro calls (TMP.TextMeshPro.text for example) as the TMP scripts are not included in the project.

    I've tried all the usual Library/Temp folder deletion, .sln/.csproj deletion, and appdata package cache deletion to no avail.
     
  3. dstvr123

    dstvr123

    Joined:
    Jan 31, 2017
    Posts:
    1
    I am seeing this too.
    Opening a script (in visual studio 2015) yields a solution in which the following projects exist but their resources directories are missing the files that the project thinks they have:
    UnityEditor.StandardEvents
    UnityEditor.PackageManagerUI.Editor
    As such they fail to build so I can't build my project here for debugging.

    If you navigate to your Unity 2018.2 installation:
    C:\Program Files\Unity2018p2p0f2\Editor\Data\Resources\PackageManager\Editor
    Find the file for the package you are missing (com.unity.package-manager-ui-1.9.11)
    You can unzip (twice) the package files then paste them into your project (line up the Editor folder)
    <YourProjectDir>\Packages\com.unity.package-manager-ui
    Your visual studio project will now build.

    This is all needed on a new project so who tested this...
     
    leshemamit and Gizambica like this.
  4. mons00n

    mons00n

    Joined:
    Sep 18, 2013
    Posts:
    304
    hrm my packages folder is empty too. Will attempt to copy them from the editor install. Thanks for the tip @dstvr123
     
  5. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    120
    Unity also seems to unzip/download the packages to the cache folder, located here:

    C:\Users\<USERNAME>\AppData\Local\Unity\cache\packages\packages.unity.com

    Copy the messed up package you need to the folder:

    <PROJECT>\Packages\

    Then remove the version tagged on the end (eg: '@1.9.10')

    Seems to fix the compile errors for me
     
    mrboembastic, Binco97 and Ham-Dongki like this.
  6. mons00n

    mons00n

    Joined:
    Sep 18, 2013
    Posts:
    304
    for those of you on a mac they're located here:
    /Users/<USERNAME>/Library/Unity/cache/packages/packages.unity.com
     
    ow3n likes this.
  7. onnep

    onnep

    Joined:
    Jan 3, 2018
    Posts:
    10
    On Mac it (debugging and compiling) seems to work, but on Windows I needed to make a batch script to copy the Packages I need... :/
     
  8. _karl

    _karl

    Joined:
    Feb 6, 2017
    Posts:
    13
    This problem is new to me, as far as I know you do not need to have any package in the packages folder (except for the local ones). The packages are directly imported into the project over the cache by Unity.

    Maybe you have a similar problem like me, I had an old version of VS. Further details in this thread:
    https://forum.unity.com/threads/local-package-outside-of-project-folder.540170/
     
  9. onnep

    onnep

    Joined:
    Jan 3, 2018
    Posts:
    10
    Thanks _karl, updating the VS to 15.7.5 fixed the issue for me.
     
  10. Gizambica

    Gizambica

    Joined:
    Jul 12, 2017
    Posts:
    5
    Thanks dstvr123, this worked on my project
     
  11. _karl

    _karl

    Joined:
    Feb 6, 2017
    Posts:
    13
    @Gizambica
    You know thats not actually a solution. Please try updating Visual Studio and VS Tools for Unity as I suggested.
     
  12. kayy

    kayy

    Joined:
    Jul 26, 2011
    Posts:
    110
    @_karl I had VS 15.7.5 before updating from 2017.1.6 to 2018.2.1 but I have the same TextMeshPro errors showing up.
    I then installed the VSTU and SyntaxTree updates as suggested in the referenced thread but with no success. Even worse Unity showed a number of errors at startup in case of IL2CPP scripting backend. No show stoppers but annoying.

    Finally copying the TextMeshPro package manually (liek @McNuggetz2 suggested) was the only way to get it running.

    My target is UWP Hololens and I want to continue using .NET scripting backend which is way more convenient for development especially when a bunch of config files need to be added.

    All in all it is pretty weird and I don't like this solution, but I don't know anything better.
     
  13. ClearRoseOfWar

    ClearRoseOfWar

    Joined:
    Sep 6, 2015
    Posts:
    89
  14. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    311
    I'm having the same problem - Unity 2018.2.2.

    Using TextMeshPro as an example:

    - Use the package manager in Unity to add TextMeshPro.
    - The package is downloaded and extracted into the cache folder: \Users\[user]\AppData\Local\Unity\cache\packages
    - The c# sln is updated with a new project added for TextMeshPro.
    - Open the sln in Visual Studio 2015, and you will notice the TextMeshPro project structure there.
    - However, all the files are missing.
    - Check the local packages folder in your Unity project, and you will notice the TextMeshPro directory structure,
    but without any files.

    Presumably, Unity is supposed to copy the package from the cache into your local project structure.
    That's not working.

    At the moment, you have to manually copy the package into the local project folder under /packages.

    Anyone at Unity aware of this bug?
     
  15. halken

    halken

    Joined:
    Mar 11, 2017
    Posts:
    7
    Same problem for me with every version of Unity since 2018.1 I think. Currently using 2018.2.3f1. Contacted support about this a while ago and they weren't able to help me. I also updated VS to the latest - does not help.

    Unity, get your act together please and fix it! Even creating a brand new project does not work. Cannot build in Visual Studio.
     
  16. okcompute_unity

    okcompute_unity

    Joined:
    Jan 16, 2017
    Posts:
    756
  17. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    311
    BTW - I solved this by switching to Visual Studio 2017. The entire sln / csproj structure changed, and all the issues went away. The structure looks a lot simpler in Visual Studio 2017. Not sure if this related to Visual Studio or a different version of the Unity tools for VS.
     
  18. nav5

    nav5

    Joined:
    Nov 28, 2017
    Posts:
    5
    hi,
    i'm using visual studio 2017 with unity 2018.2.1f1 and i face the same problem too, is there any solution yet ?
    Thanks
     
  19. okcompute_unity

    okcompute_unity

    Joined:
    Jan 16, 2017
    Posts:
    756
    @nav5, are you using the latest version of VS 2017 and the latest version of VSTU?
     
    mgeorgedeveloper likes this.
  20. nav5

    nav5

    Joined:
    Nov 28, 2017
    Posts:
    5
    hi, thank you for reply,
    i'm using VS 2017 15.4.2
    VSTU 3.4.0.2
    Edit : I update the VS to latest version and it works fine now ,thank you
     
    Last edited: Sep 6, 2018
  21. kayy

    kayy

    Joined:
    Jul 26, 2011
    Posts:
    110
    I just updated to Visual Studio 2017 15.8.4 with VSTU 3.8.0.3 but unfortunately it is still not working. I need to copy TextMesh Pro manually.

    I am on Unity 2018.2.5f1, Platform UWP / Hololens with Scripting Backend .NET. For testing I created an empty project and it is working fine. So it seems to be some combination of ingedients that is poisoning our project, MRTU, NewtonSoftJson, our own .NET Standard 1.4 DLLs, ...
     
  22. okcompute_unity

    okcompute_unity

    Joined:
    Jan 16, 2017
    Posts:
    756
    Hi @kayy,

    Could you try to remove one ingredient after the other to see when it starts to work again?

    Regards,

    Pascal
     
  23. kayy

    kayy

    Joined:
    Jul 26, 2011
    Posts:
    110
    Hi @okcompute_unity ,

    I would like to :) but the project has grown in complexity and it would take too long. My customer won't like me to investigate something, we have a workaround for.
    I forgot to mention that the errors do show up only on .NET scripting backend which is marked as deprecated. So chances are high that Unity has low priority in fixing bugs for something which will be obsolete in the future (what is reasonable for me).

    So we will live with this little hack as we highly prefer the smoothness of .NET backend in development over IL2CPP, which we use for release builds only.
     
  24. okcompute_unity

    okcompute_unity

    Joined:
    Jan 16, 2017
    Posts:
    756
    Totally understand :) If you ever get blocked again, don't hesitate to reply back! :)

    Regards,

    Pascal
     
    kayy likes this.
  25. LHAppri

    LHAppri

    Joined:
    Aug 18, 2017
    Posts:
    20
    @okcompute_unity. Same problem - empty packages folder structure and project will not compile.
    This is particularly annoying as I am working on a number of different Unity projects so have to fix it for each one. Not to mention having to remove the unwanted excess packages (Ads, Purchasing etc) from each project as well.

    I am using VS2015 - is there any chance of getting Unity packages working with that or is Unity really only going to be compatible with VS2017 from 2018.2 onwards?
     
  26. okcompute_unity

    okcompute_unity

    Joined:
    Jan 16, 2017
    Posts:
    756
  27. sperepel

    sperepel

    Joined:
    Jul 29, 2016
    Posts:
    17
    If you install new version of VS and then delete all those extra folders from Packages and then restart VS it works.
     
    pedro_unity likes this.
  28. clarHandsome

    clarHandsome

    Joined:
    Mar 26, 2017
    Posts:
    9
    Confirmed. Problem fixed. Current version: 15.8.8
     
  29. clarHandsome

    clarHandsome

    Joined:
    Mar 26, 2017
    Posts:
    9
    In my case, just update the VS and there's no need to manually delete any folders.
     
    pedro_unity likes this.
  30. pedro_unity

    pedro_unity

    Joined:
    Jan 16, 2017
    Posts:
    172
  31. sjando

    sjando

    Joined:
    Nov 6, 2017
    Posts:
    18
    This is still an issue as of latest Unity (2018.2.14f) and VS (15.8.9). It seems to be specific to UWP with .NET scripting backend when building with 'Unity C# Projects' enabled.

    Take a completely fresh, new project. TextMeshPro is included by default. Build for UWP with .NET backend and C# projects enabled. Unity build will succeed but the generated project build will fail with a bunch of missing TextMeshPro files (see attached screen). Same happens with any extra packages added via package manager.

    We've fixed this with a Build Postprocessor that replaces the paths in the generated project with the correct ones but it's pretty painful since the required information to do so properly (e.g. real paths of packages, including not just direct dependencies but multiple levels of nested dependencies) doesn't seem to be available without making multiple web requests via PackageManager.Client.Search. I know .NET backend is deprecated but for many working on UWP-centric projects (e.g. HoloLens) .NET + C# Projects is still the preferred development workflow so it'd be great to have that working out of the box again.

    capture.png
     
    kayy likes this.
  32. pedro_unity

    pedro_unity

    Joined:
    Jan 16, 2017
    Posts:
    172
    Hello @stuart-anderson-csiro,

    Please update VSTU and let me know if that fixes the issue.

    Thanks,
    Pedro
    Unity STE
     
  33. sjando

    sjando

    Joined:
    Nov 6, 2017
    Posts:
    18
    Hi @pedro_unity, I've updated to VS 3.9.2 with VSTU 3.9.0.2 and can still reproduce this on an empty project (using Unity 2018.2.16f1)
     
  34. pedro_unity

    pedro_unity

    Joined:
    Jan 16, 2017
    Posts:
    172
    Hello @stuart-anderson-csiro,

    Thanks for checking. Let me circle back and see what the problem might be.

    Cheers,
    P.
     
  35. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Please try upgrading to the latest release of Visual Studio 2017 which is 15.9.2.
     
  36. sjando

    sjando

    Joined:
    Nov 6, 2017
    Posts:
    18
    That 3.9.2 above was a mistype, I am using 15.9.2 with what I believe is latest VSTU (3.9.0.2, installed with the VS 15.9.2 update)
     
  37. kayy

    kayy

    Joined:
    Jul 26, 2011
    Posts:
    110
    I am in the process of switching a HoloLens UWP project from scripting backend .NET to IL2CPP.
    With Unity 2018.4.5 and newest Visual Studio 15.9.15 I ran into several package related errors like:

    Error CS2001 Source file XXX\Packages\com.unity.xr.windowsmr.metro\Runtime\HoloLensInputModule.cs could not be found. Unity.XR.WindowsMR.Player

    The same shows up for TextMeshPro and others.
    I am talking about the C# solution not the C++ solution build output.

    I deleted all genereated csproj and sln files, Library, AppData/Local/Unity/Cache, repaired Visual Studio but nothing helped. Looking into the csproj file reveals:
    <Compile Include="Packages\com.unity.xr.windowsmr.metro\Runtime\AudioSpatializer.cs" />
    This folder does exist but it's empty.

    Another strange thing is that my csproj files
    <LangVersion>6</LangVersion>
    This leads to a bunch of errors like
    CS8059 Feature 'expression body property accessor' is not available in C# 6. Please use language version 7.0 or greater

    All this disappears when I switch back to .NET. Well then I have to have a manual copy of the TextMesh Pro package in my Packages folder like explained above in the thread.
    Furthermore it is possible to connect the debuggger to Unity Editor without problems.

    Very strange. Any suggestions? Thanks
     
  38. kayy

    kayy

    Joined:
    Jul 26, 2011
    Posts:
    110
    As a workaround I managed to get rid of all the errors but this is a bit hacky:

    First I copied the missing package files content from Unity's library cache (AppData/Local) to the project's Package folder.

    Inspired by "Unity 2018.3 + Visual Studio 2015 -> Invalid "latest" for /langversion" from Unity Answers I manipulated the generated csproj files by replacing "<LangVersion>6</LangVersion>" with "<LangVersion>latest</LangVersion>".

    Combined with other hacks like changing package manifest depending on the target platform (AR Foundation does not play well with Windows.MR but this was disabled to investigate the problem above) I have a unpleasant feeling like reaching the limit of all possible workarounds.

    Maybe 2019.2 fixes some of the issues. I will test it soon