react-native-template-typescript icon indicating copy to clipboard operation
react-native-template-typescript copied to clipboard

fails to install CocoaPods deps

Open JDMathew opened this issue 2 years ago • 9 comments

Expected results

If I run npx react-native init example then CocoaPods dependencies are installed correctly but running npx react-native init example --template react-native-template-typescript fails on this step

Observed results

even after running cd ./example/ios && pod install this still fails

JDMathew avatar Apr 13 '22 12:04 JDMathew

I had a similar problem but solved it by uninstalling cocoapods, by running gem uninstall cocoapods followed by reinstalling cocoapods with Homebrew brew install cocoapods. Afterward just running pod install worked fine for me :)

Keffin avatar Apr 24 '22 09:04 Keffin

I had a similar problem but solved it by uninstalling cocoapods, by running gem uninstall cocoapods followed by reinstalling cocoapods with Homebrew brew install cocoapods. Afterward just running pod install worked fine for me :)

Strange because when I setup my mac I did run a gem uninstall cocoapods and installed it via brew so I shouldn't have lingering gem cocoapods issues but maybe it is the version. I will update cocoapods via brew and see if it fixes it.

JDMathew avatar Apr 26 '22 13:04 JDMathew

I noticed that you have to run npm install before you run cd ios && pod install. I also had to run bundle install for it to find cocoapods.

selbekk avatar May 03 '22 10:05 selbekk

I updated to react-native 0.69, when I try to start a new project, the following error raised:

✖ Installing CocoaPods dependencies (this may take a few minutes)
✖ 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.

I am using cocoapods from homebrew

kockok avatar Jun 24 '22 03:06 kockok

@kockok is this during react-native init command?

radko93 avatar Jun 24 '22 07:06 radko93

@kockok is this during react-native init command?

Yes, this is not specific to the --typescript-template as I get this error even without specifying a template...

~/app: npx react-native init myApp                         
 
✔ Downloading template
✔ Copying template
✔ Processing template
✖ Installing CocoaPods dependencies (this may take a few minutes)
✖ 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 ./myApp/ios && pod install".
CocoaPods documentation: https://cocoapods.org/

kockok avatar Jun 24 '22 11:06 kockok

I'm getting the same error (0.69) and doesn't seem to be related to cocoapods not being found (and not limited to this template). Doing a manual pod install in the iOS directory gives the more verbose error below . I get the same results when I drop the --template (so just npx react-native init my app) so it appears to be an issue with 0.69 and/or react-native-cli 8.0.x. pod install --repo-update in the ios directory makes everything work.

[!] CocoaPods could not find compatible versions for pod "Flipper-DoubleConversion":
  In Podfile:
    Flipper-DoubleConversion (= 3.2.0.1)

None of your spec sources contain a spec satisfying the dependency: `Flipper-DoubleConversion (= 3.2.0.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.

gorbypark avatar Jul 03 '22 14:07 gorbypark

I get same problem

In my other os, can work, but here is not work

how to do in it problem ?

Timson020 avatar Aug 30 '22 12:08 Timson020

Simply run pod repo update before creating the react-native app. Cocoapods holds a list of all pods locally. By executing the command above you refresh that list. works for me. 🚀

tomamatics avatar Nov 15 '22 23:11 tomamatics