Scoped package registries
Automatic conflict resolution

Package conflicts

When you add a package to a 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
, Unity considers that package a dependency of the Project. However, a package can also have dependencies on other packages, which might create indirect dependencies in a Project that uses this package.

Direct and indirect package dependencies
Direct and indirect package dependencies

In this example, if you install Package A and Package B in your Project, then your Project has direct dependencies on both Package A and Package B. However, if Package B also has a dependency on Package C, then your Project also has an indirect dependency on Package C.

A conflict exists when a Project has dependencies on a package with different versions. A conflict can only exist between two indirect dependencies, when neither is added explicitly in the dependencies of the Project’s manifest file.

To resolve the package conflict, Unity considers the version number of the conflicted package and the number of levels of dependencies between the root and the packages. If you prefer to use a different version of the package, you can also override Unity’s solution.


对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答