When Unity loads a project, the Unity Package Manager reads the project manifest so that it can compute a list of which packages to retrieve and load. When a user installs or uninstalls a package through the Package Manager window, the Package Manager stores those changes in the project manifest file. The project manifest file manages the list of packages through the dependencies object.
In addition, the project manifest serves as a configuration file for the Package Manager, which uses the manifest to customize the registry URL and register custom registries.
You can find the project manifest file, called manifest.json
, in the Packages
folder under the root folder of your Unity project. Like the package manifest file, the project manifest file uses JSON (JavaScript Object Notation) syntax.
All properties are optional. However, if your project manifest file does not contain any values, the Package Manager window doesn’t load, and the Package Manager doesn’t load any packages.
Key | JSON Type | Description |
---|---|---|
dependencies | Object | Collection of packages required for your project. This includes only direct dependencies (indirect dependencies are listed in package manifestsEach package has a manifest, which provides information about the package to the Package Manager. The manifest contains information such as the name of the package, its version, a description for users, dependencies on other packages (if any), and other details. More info See in Glossary). Each entry maps the package name to the minimum version required for the project: { "dependencies": { "com.my-package": "2.3.1", "com.my-other-package": "1.0.1-preview.1", etc. } } Specifying a version number indicates that you want the Package Manager to download the package from the package registry (that is, the source of the package is the registry). However, in addition to using versions, you can also specify a path to a local folder or tarball file, or a Git URL. Note: You do not need to specify embedded packages here because the Package Manager finds them inside your project’s Packages folder and loads them automatically. The Package Manager ignores any entry if there is an embedded package with the same name in its own package manifest. |
enableLockFile | Boolean | Enables a lock file to ensure that dependencies are resolved in a deterministic manner. This is set to true by default. For more information, see Using lock files. |
resolutionStrategy | String | Upgrades indirect dependenciesAn indirect, or transitive dependency occurs when your project requests a package which itself “depends on” another package. For example, if your project depends on the alembic@1.0.7 package which in turn depends on the timeline@1.0.0 package, then your project has an direct dependency on Alembic and an indirect dependency on Timeline. More infoSee in Glossary based on Semantic Versioning rules. This is set to lowest by default. For more information, see Setting a resolution strategy below. |
scopedRegistries | Array of Objects | Specify custom registries in addition to the default registry. This allows you to host your own packages. See Scoped Registries for more details. |
testables | Array of Strings | Lists the names of packages whose tests you want to load in the Unity Test FrameworkThe Test Framework package (formerly called the Test Runner) is a Unity tool that tests your code in both Edit mode and Play mode, and also on target platforms such as Standalone, Android, or iOS. More info See in Glossary. For more information, see Adding tests to a package. Note: You do not need to specify embedded packages here because the Unity Test Framework assumes they are testable by default. |
{ "scopedRegistries": [{ "name": "My internal registry", "url": "https://my.internal.registry.com", "scopes": [ "com.company" ] }], "dependencies": { "com.unity.package-1": "1.0.0", "com.unity.package-2": "2.0.0", "com.company.my-package": "3.0.0", "com.unity.my-local-package": "file:<path>/my_package_folder", "com.unity.my-local-tarball": "file:<path>/my_package_tarball.tgz", "com.unity.my-git-package": "https://my.repository/my-package.git#v1.2.3" }, "enableLockFile": true, "resolutionStrategy": "highestMinor", "testables": [ "com.unity.package-1", "com.unity.package-2" ] }
While you can force Unity’s package dependency resolution to use higher versions of indirect dependencies by adding them explicitly to the project manifest, this isn’t a good strategy, for two reasons:
A better approach is to customize how the Package Manager selects indirect dependencies based on Semantic Versioning rules by setting the resolutionStrategy property:
Value: | Description: |
---|---|
lowest | Do not upgrade indirect dependencies. Instead, it uses exactly the requested version. This is the default mode. |
highestPatch | Upgrade to the highest version with the same Major and Minor components. For example, with the requested version 1.2.3, this strategy selects the highest version in the range [1.2.3, 1.3.0) (that is, >= 1.2.3 and < 1.3.0 ). |
highestMinor | Upgrade to the highest version with the same Major component. For example, with the requested version 1.2.3, this strategy selects the highest version in the range [1.2.3, 2.0.0) (that is, >= 1.2.3 and < 2.0.0 ).Note: Version 1.0.0 marks the first stable, production-ready version. Below that, versions 0.X.Y indicate that their API is not yet stable, and successive minor versions might introduce breaking changes. This part of the SemVer specification allows releasing early versions of a package without hampering rapid development. Because of this, when the target version is 0.X.Y , highestMinor behaves like highestPatch in order to ensure choosing a backward-compatible version. For example, with the requested version 0.1.3 , this strategy selects the highest version in the range [0.1.3,0.2.0) . |
highest | Upgrade to the highest version. For example, with the requested version 1.2.3, this strategy selects the highest version in the range [1.2.3,) (that is, >= 1.2.3 with no upper bound) |
Note: These ranges never allow a dependency to jump from a stable release to an experimental or pre-release package.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
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.
Provide more information
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:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.