xcodeswift-package-manager

Xcode 14.0 - A PackageIndex.findPackages failed: featureDisabled warning


Since I upgraded to Xcode 14.0, I have the following warning: PackageIndex.findPackages failed: featureDisabled.

Web search did not yield anything.

I have a single SPM package, but there doesn't seem to be any issues.

Does anybody know how to get rid of this warning?

PackageIndex.findPackages failed: featureDisabled


Solution

  • This is what I had to do using Xcode 14.0:

    1. Made sure the Xcode project for the Swift Package was CLOSED.
    2. Selected the Project in Xcode and under Package Dependencies picked the + to add a new package.
    3. Selected Add Local... and then picked the folder for my Swift Package (the folder that contains the package file)
    4. Did a clean build and QUIT Xcode
    5. Re-opened Xcode.
    6. Build. If it still fails, do the next step.
    7. Select your target in the Xcode project and scroll to Frameworks, Libraries... Then pick the + and you should see your package listed as a framework. Select it and pick Add. Now Build.

    Step 2 is necessary to create a folder called "Packages" in your project. After Step 3, your package appears but is not expandable (to see the sources). Once you re-start Xcode and open this project (Step 5) the package should be fully visible.

    I had to also do Step 7 to make this work. However, I have done this WITHOUT needing Step 7. It's unclear why this happens.

    Apple's documentation says you can drag your package's folder into the Project Navigator, but I have only been able to get that to work once. Every other time I've had to follow these steps, occasionally using Step 7.

    Apple needs to finish this so using Swift Packages is simple. Its really a wonderful thing, but being able to use the package locally is critical to maintaining it easily