Good Day,
I was working on a project and did a build onto my device for some testing and close down the computer for a few days. When I went to open the project back up today Im being met with this error.
"the package manifest at ‘/Package.swift’ cannot be accessed (/Package.swift doesn’t exist in file system)"
I tried all the recommended solutions I saw here on Stack with no resolution. The strange thing is that I didn’t touch anything and did a build before closing it down so I’m downright stumped into whats going on here.
To help test, I made a totally new project and started to import some packages that I had on my other project. That project works just fine and the files seem to be the same.
Any help on solving this would be appreciated
3
Answers
Does your project build successfully even while showing the error? Can you successfully Run it on a simulator or testing device?
If so, you may be able to fix this error by resetting the package cache
And then quitting Xcode (
⌘Q
) and reopening it.For me the issue was an invalid version for the
from
argument. In my case I hadBut
1.0.0
was not a valid git tag. So I checked https://github.com/Tyler-Keith-Thompson/CucumberSwift/tags and saw that4.2.1
was the latest tag. Once I change the.package
to use4.2.1
, the error went away.Check that the SwiftPackage you want to import is setup correctly.
The Package.swift file has to be in the base level folder. By default swift package projects are created wrong. So you have to create a new folder in the repo. Move all files into it, except Package.swift. You have to move it (Package.swift) in the base level git folder. The structure should look like this:
After that open the Package.swift file with text editor and add custom paths to the targets like this:
Now just double click the Package.swift file and it should open and build without problems.
I had the same issue when i created new package and imported it into another one.
Good luck.