- Home /
How to work with Unity Package Manager in Unity 2017.2.x+
Unity Package Manager was added in 2017.2.x. When upgrading our project, we saw that it creates a bunch of empty folders for packages in the project folder, as follows:
.
└── Packages
├── com.unity.ads
├── com.unity.ads@2.0.3
├── com.unity.analytics
├── com.unity.analytics@2.0.13
├── com.unity.purchasing
├── com.unity.purchasing@0.0.19
├── com.unity.standardevents
└── com.unity.standardevents@1.0.10
All of them are empty. The generated manifest is also empty:
$ cat UnityPackageManager/manifest.json
{
"dependencies": {
}
}
This raises a few questions:
Are those empty folders actually used? Removing them and re-opening the project seems to re-create them.
Do they need to (or should) be checked into the project repository? Since they are generated empty, they cannot be added to Git or Mercurial (which is what we use).
How do we pick or pin specific packages or versions of those packages?
How do we guarantee that our project is built with the same versions across all developer machines and build machines? The last thing we want is one of the machines to randomly pick a different version of a package and produce different results! I tried moving the contents of those packages from my local user folder into the project folder and repository, but the moved files do not seem to be used, and instead the ones in local user folder get repopulated...
Answer by okcompute_unity · Mar 03, 2018 at 09:55 PM
Hi @zzgrzyt ,
1. You should not see these folders in the project browser. If this is the case, please open a bug. 2. The file manifest.json
should be persisted in your source control system. Please see https://docs.unity3d.com/Manual/ExternalVersionControlSystemSupport.html for more info. (Please note the folder was renamed Packages
in 2018.1) 3. In 2017.2, this should not be exposed as stated above. So you cannot do anything. In 2018.1, a proper UI is exposed to manage packages. 4. The project manifest (`manifest.json`) will give you this guarantee.
Regards,
Pascal
These folders are in the project folder on disk, not visible in the Unity Editor project browser.
O$$anonymous$$
O$$anonymous$$
So, in 2018.1 the
manifest.json
is properly populated and allows for control, but in earlier versions it's "broken" as in cannot actually control the versions? Is it possible that in 2017.2 or 2017.3 Unity will "randomly" decide to update one of these packages on its own?
Thanks for the answers!
1 - This is strange. You shouldn't see this in your project. This strangely looks like the folder layout of the cache. Can you give me the path of your project?
4 - In 2017.2 or 2017.3, the package manager is not used at all. Nothing should be populated. The intention was there to enable the feature but in the end we did not had the time to introduce a proper UI.
Your answer
Follow this Question
Related Questions
"This project is using a new input system but..." window that is not fully visible 1 Answer
How to access Unity.UI classes in script in Unity 2019.2.1? 0 Answers
How do we make UPM show that there is a newer package for a package installed via git URL? 0 Answers
Unity packages not working when are included in the same scene 0 Answers