iOS CocoaPods build fails: Package.swift included in sources causes No such module 'PackageDescription'

Open Beginner friendly
#280 0 comments 0 reactions 0 assignees View on GitHub

@dattm97 is already working on this.

Since Dec 4, 2026.

  • #281 by @dattm97 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
react-native
Domain
mobile

Research direction

The issue identifies the podspec source glob and ios/Package.swift as the cause. Read the podspec and inspect the generated Pods project’s Sources build phase to confirm the manifest is included. Done means CocoaPods excludes the manifest from library sources; the issue reports that pod install succeeds, but a full app rebuild is still unverified.

Written by the indexing model from the issue text.

Description

Description

An iOS app using react-native-background-actions 4.2.0 through CocoaPods fails to build in Xcode:

No such module 'PackageDescription'
Unable to resolve module dependency: 'PackageDescription'
Environment
  • react-native-background-actions: 4.2.0
  • React Native: 0.88.1
  • Integration: CocoaPods
  • App minimum iOS version: 15.5
  • Package manager: Yarn 4.18.1
Steps to reproduce
  1. Install version 4.2.0 in a React Native iOS app using CocoaPods.
  2. Run pod install.
  3. Open the generated .xcworkspace and build in Xcode.
Expected behavior

CocoaPods should compile the library implementation without compiling the Swift Package Manager manifest.

Root cause

The podspec includes all Swift files directly under ios:

s.source_files = "ios/*.{h,m,swift}"

This also matches ios/Package.swift, which imports PackageDescription. Inspection of the generated Pods.xcodeproj/project.pbxproj confirmed that Package.swift was added to the library target's Sources build phase.

Suggested fix

Exclude the SwiftPM manifest in the podspec:

s.source_files = "ios/*.{h,m,swift}"
s.exclude_files = "ios/Package.swift"
Local verification

Applied this one-line change using a persistent Yarn patch and reran yarn install and pod install successfully. The regenerated Pods project no longer contains Package.swift as a source file. A full app rebuild has not yet been verified.

Dominant language
Java
Stars
941
Forks
145
Avg merge
1d 23h
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Rapsssito/react-native-background-actions

All issues in Rapsssito/react-native-background-actions

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.