Xcode 14.0 - A PackageIndex.findPackages failed: featureDisabled warning
Asked Answered
O

5

25

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

Ophicleide answered 17/9, 2022 at 3:55 Comment(1)
I had this same problem today. It went away after I reopened my project in Xcode and cleaned the build folder. Hope this helps.Physostomous
R
4

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

Raised answered 23/9, 2022 at 14:43 Comment(1)
It's surprising, but in addition to doing a clear, you have to quit and reopen Xcode. Thanks.Ophicleide
M
26

All I had to do is to go to

  • Xcode -> Product -> Clear All Issues
  • Xcode -> Product -> Clean Build Folder
  • Build

And just by magic, the warning disappeared!

Maiduguri answered 23/11, 2022 at 13:41 Comment(0)
B
7

Simply cleaning and building the project again fixed it for me

Beera answered 13/10, 2022 at 12:23 Comment(0)
R
4

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

Raised answered 23/9, 2022 at 14:43 Comment(1)
It's surprising, but in addition to doing a clear, you have to quit and reopen Xcode. Thanks.Ophicleide
W
3

I was able to fix a similar issue I had by selecting the target in the Xcode project and scroll to Frameworks, Libraries... Then pick the + and you should see your package listed as a framework. Select them and pick Add.

IMPORTANT: It may look like the libraries are already added but go ahead and add them again without deleted the existing entries. You won't create duplicates, it just forces XCode to recreate the necessary indexes that were missing. I think this is a bug when adding packages from a Git URL.

Whirligig answered 24/9, 2022 at 15:16 Comment(0)
L
2

i managed to get rid of these warnings by running the following from inside the directory where your project's .xcodeproj file resides:

xcodebuild -resolvePackageDependencies -project MyProject.xcodeproj -scheme MyScheme -platform="iOS, name:'Any iOS Device'"

Running this command might show some warnings in the terminal,
i received the following warning in my case...

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:xxx-xxx }
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
...

Open your project after successfully executing this command,
and wait for the packages to get resolved and indexing to get done before trying to compile the project.

This solution was originally posted here by David to resolve another Swift Package Manager issue,
but this works well for resolving the issue asked in the OP as well.

Hope this helps.

Lagniappe answered 10/10, 2022 at 13:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.