The dependencies attribute in the Project manifestEach Unity Project has a Project manifest, which acts as an entry point for the Package Manager. This file must be available in the <project>/Packages directory. The Package Manager uses it to configure many things, including a list of dependencies for that Project, as well as any package repository to query for packages. More info See in Glossary is a JSON object that maps a package name to a version. The version number indicates which version of the package to download from the package registry. For example:
{
"dependencies": {
"com.my-package": "2.3.1",
"com.my-other-package": "1.0.1-preview.1",
etc.
}
}
In addition to using version numbers, the Package Manager also supports adding Project dependencies with the following:
A direct dependency is a Project-level dependency. When you install a package through the Package Manager window, or manually edit the Project manifest.json file to explicitly add a dependency, you are creating a direct package dependency ():
Packages can declare their own dependencies to other packages. Such package dependencies become indirect (), or transitive, dependencies of your Project when you install the package.
The Package Manager determines which version of each package to install, no matter how it becomes a dependency of your Project. To do this, it prioritizes direct dependencies over indirect dependencies, as long as the higher priority version doesn’t violate any other requirements.
This evaluation is called dependency resolution, and roughly follows this logic:
Select the version of the direct dependency.
If there is no direct dependency and this is a built-in packageBuilt-in packages allow users to toggle Unity features on or off through the Package Manager. Enabling or disabling a package reduces the run-time build size. For example, most Projects don’t use the legacy Particle System. By removing the abstracted package of this feature, the related code and resources are not part of the final built product. Typically, these packages contain only the package manifest and are bundled with Unity (rather than available on the package registry). See in Glossary version, select the built-in version.
If there is no direct dependency and this is not a built-in version, check whether this is an indirect dependency of more than one package:
If this is an indirect dependency of only one package in the Project, there is no conflict, so select the higher of these versions:
This indirect dependency’s version
The minimum version required by Unity
If multiple indirect dependencies occur, that might create a conflict if the indirect dependencies request more than one version. The Package Manager can resolve most conflicts with an automatic conflict resolution strategy.
In any case, you can manually override these resolution strategies. To do this, request a specific version in the Project manifest (either by installing from the Package Manager window or by editing the manifest directly). This creates a direct dependency, which takes precedence over any resolution strategy.
Did you find this page useful? Please give it a rating:
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thanks for helping to make the Unity documentation better!