---
title: Resolving package dependency failures
framework: swift-package-manager
role: article
role_heading: Article
path: swift-package-manager/documentation/packagemanagerdocs/resolvingdependencyfailures
---

# Resolving package dependency failures

Understand dependency failure scenarios.

## Overview

Overview You define constraints for dependencies when you add them to your package, and those constraints can not always be met. Prior to running a build or test, or when you run swift package resolve, the package manager walks through the dependencies in your package, and all their dependencies recursively, to build a complete list. It then attempts to choose a version of each dependency that fits within the constraints of your package, and any constraints provided by your dependencies. If all the dependencies are available and resolved, the versions are recorded locally in the file Package.resolved. You can view these dependencies using the command swift package show-dependencies, which provides a succint list of the entire set of dependencies. If the dependencies can’t be resolved, for example when the packages your package depends on have conflicting constraints, the package manager returns an error, describing the conflicting constraint: error: Dependencies could not be resolved because root depends on 'pkgb' 0.1.0. 'pkgb' 0.1.0 cannot be used because 'pkgb' 0.1.0 depends on 'pkga' 0.3.0 and root depends on 'pkga' 0.4.0. Rework your dependencies, or update a package you want to depend upon, to resolve any conflicting constraints. Failure Scenarios There are a variety of scenarios that may occur, including:

## See Also

- [Resolving and updating dependencies](swift-package-manager/documentation/packagemanagerdocs/resolvingpackageversions.md)
- [Providing configurable packages using traits](swift-package-manager/documentation/packagemanagerdocs/packagetraits.md)
- [Adding a dependency on a system library.](swift-package-manager/documentation/packagemanagerdocs/addingsystemlibrarydependency.md)
- [Swift package example that uses system library dependency with pkg-config](swift-package-manager/documentation/packagemanagerdocs/examplesystemlibrarypkgconfig.md)
- [Editing a remote dependency used in a Swift package](swift-package-manager/documentation/packagemanagerdocs/editingdependencypackage.md)
