Skip to content

Automatically handle CocoaPods being out of date while creating a new project #1060

@grabbou

Description

@grabbou

When initing a new project and having out-dated CocoaPods repository, React Native init can fail with the following output:

✔ Downloading template
✔ Copying template
✔ Processing template
⠇ Installing CocoaPods dependencies (this may take a few minutes)Analyzing dependencies
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
[!] CocoaPods could not find compatible versions for pod "FlipperKit":
  In Podfile:
    FlipperKit (~> 0.33.1)

None of your spec sources contain a spec satisfying the dependency: `FlipperKit (~> 0.33.1)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

✖ Installing CocoaPods dependencies (this may take a few minutes)
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
Please try again manually: "cd ./RNTestProject/ios && pod install".

We should try/catch this and handle as recommended, that is run pod repo update and repeat.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions