SwiftPM "the package manifest at '/Package.swift' cannot be accessed" in CI
SwiftPM looks for Package.swift in the current working directory and could not read one there. The manifest is missing, the step ran from the wrong directory, or the checkout did not fetch it.
What this error means
swift build or swift test fails immediately with "error: the package manifest at '/Package.swift' cannot be accessed" before any compilation begins.
error: the package manifest at '/Package.swift' cannot be accessed (/Package.swift doesn't exist in file system)Common causes
The step runs from the wrong working directory
The package lives in a subfolder (for example ios/ or Sources/App), but the job invoked swift build from the repository root where no Package.swift exists.
A shallow or sparse checkout omitted the manifest
A custom checkout that filtered paths, or a submodule that was not initialized, left the directory without its Package.swift.
How to fix it
Run the build from the package directory
- Confirm where
Package.swiftlives in the repo. - Set the step
working-directory, or pass--package-pathto swift. - Re-run so SwiftPM reads the manifest from the right place.
- name: Build
working-directory: ios
run: swift build
# or without changing directory:
# swift build --package-path iosCheck out the full tree including submodules
Ensure the manifest is actually present on the runner before building.
- uses: actions/checkout@v4
with:
submodules: recursiveHow to prevent it
- Set
working-directoryexplicitly for packages that are not at the repo root. - Use
--package-pathin scripts so the manifest location is unambiguous. - Initialize submodules in checkout when the package depends on them.