PC パソコン

How to Fix “No such module ‘Playgrounds’” for Mac Catalyst in Xcode

In Xcode 26 Beta 1, code that uses a Playground macro can fail to compile for Mac Catalyst because the Playgrounds module cannot be found. Apple resolved this known issue in Xcode 26 Beta 2.

Representative error

error: no such module 'Playgrounds'
Build failed because Playgrounds could not be found.

Apple describes the symptom as a Mac Catalyst build failure saying that Playgrounds cannot be found when Playground macros are present.

Cause

Xcode 26 Beta 1 had a defect in Playground macro support that prevented the required Playgrounds support module from being resolved correctly for a Mac Catalyst build. A project that compiles for an iOS simulator or a regular macOS destination but fails only for Mac Catalyst matches the documented condition.

This has a different root cause from a general Swift Package “No such module” error. Apple tracks it as issue 151029441 and lists it under the resolved issues for Xcode 26 Beta 2.

Affected conditions and versions

  • Xcode 26 Beta 1
  • Source code containing a Playground macro such as #Playground
  • Mac Catalyst selected as the build destination

The official corrected release is Xcode 26 Beta 2. Stable Xcode 26 and later releases include the correction.

Recommended solution

  1. Check the current Xcode version in About Xcode or from Terminal.
  2. Update to Xcode 26 Beta 2 or later, preferably the latest stable release.
  3. If multiple Xcode installations exist, point the command-line Developer directory to the corrected version.
  4. Remove the affected project’s Derived Data.
  5. Select Mac Catalyst, clean the build folder, and rebuild.
xcodebuild -version
xcode-select -p
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

If the error remains after updating

Remove only the affected project’s Derived Data to prevent stale compiler output from being reused.

rm -rf ~/Library/Developer/Xcode/DerivedData/<affected-project>

If the project uses Swift packages, resolve dependencies again from Xcode’s File > Packages menu before rebuilding.

Alternatives

  • Build the Catalyst target on another Mac or CI image that has a corrected Xcode release.
  • Temporarily isolate Playground macros from the product target so they are not compiled for Mac Catalyst.
  • Continue development on another supported destination and resume Catalyst builds after updating Xcode.

Removing a macro or changing target membership was not documented by Apple as a guaranteed workaround for this bug. It can change application behavior or the build graph, so treat it only as a temporary measure.

How to verify the fix

  1. Confirm that xcodebuild -version reports Xcode 26 Beta 2 or later.
  2. Select the Mac Catalyst scheme and destination.
  3. Perform a clean build and confirm that No such module 'Playgrounds' no longer appears.
  4. Verify that the file containing the Playground macro compiles and that the application launches in the Catalyst environment.

Cautions

If the error persists on a corrected release, check Xcode’s Toolchains setting, xcode-select, and the CI DEVELOPER_DIR value for references to another installation. Do not manually add Playgrounds to Package.swift; an Xcode support module is not normally repaired by treating it as an external package dependency.

Summary

No such module 'Playgrounds' when building for Mac Catalyst is a known Playground macro issue in Xcode 26 Beta 1. Update to Xcode 26 Beta 2 or later, verify the selected toolchain, clear the affected cache, and rebuild.

Official references