Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error upgrading 0.64 -> 0.66 CocoaPods could not find compatible versions for pod "RCT-Folly" #32423

Closed
1mike12 opened this issue Oct 18, 2021 · 6 comments
Labels
Needs: Triage 🔍 Resolution: Locked This issue was locked by the bot.

Comments

@1mike12
Copy link
Contributor

1mike12 commented Oct 18, 2021

Description

trying to upgrade to latest version to have access to RippleConfig.foreground in 0.66 but running into this issue on the ios side

React Native version:

System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 255.71 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.17.3 - /usr/local/opt/node@14/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.13 - /usr/local/opt/node@14/bin/npm
    Watchman: 2021.06.07.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      API Levels: 28, 29, 30
      Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.0, 30.0.2
      System Images: android-29 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.6858069
    Xcode: 12.4/12D4e - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_242-release - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.66.1 => 0.66.1 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. have 0.64 ejected project
  2. try to update to latest 0.66
  3. run npx react-native upgrade

Expected Results

successful upgrade

Snack, code example, screenshot, or link to a repository:

Auto-linking React Native modules for target `mobile`: RNCAsyncStorage, RNCMaskedView, RNGestureHandler, RNKeychain, RNScreens, RNVectorIcons, react-native-image-picker, and react-native-safe-area-context
Analyzing dependencies
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`
[!] CocoaPods could not find compatible versions for pod "RCT-Folly":
  In snapshot (Podfile.lock):
    RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)

  In Podfile:
    FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) was resolved to 0.66.1, which depends on
      RCT-Folly (= 2021.06.28.00-v2)

    RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

    at makeError (/Users/x/go/y/mobile/node_modules/execa/index.js:174:9)
    at /Users/x/go/y/mobile/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async installDeps (/Users/x/go/y/mobile/node_modules/@react-native-community/cli/build/commands/upgrade/upgrade.js:208:3)
    at async Object.upgrade [as func] (/Users/x/go/y/mobile/node_modules/@react-native-community/cli/build/commands/upgrade/upgrade.js:346:9)
    at async Command.handleAction (/Users/x/go/y/mobile/node_modules/@react-native-community/cli/build/index.js:186:9)
info Run CLI with --verbose flag for more details.
@ammarahm-ed
Copy link

Try running pod update && pod install in ios folder to fix this issue.

@Kouraman
Copy link

Kouraman commented Oct 18, 2021

Same issue, I tried pod update && pod install, but it end to a build fail

The following build commands failed:
	CompileC /Users/bribri/Library/Developer/Xcode/DerivedData/gazecraftclient-cgymczdjrscahdbibqlbskybmdbg/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/SysUio.o /Users/bribri/Desktop/test/ios/Pods/RCT-Folly/folly/portability/SysUio.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods')

@quachdev
Copy link

I ran into a similar issue before. Renaming or deleting the Podfile.lock and re-run pod install worked for my case.

@1mike12
Copy link
Contributor Author

1mike12 commented Oct 19, 2021

Thanks @quachdev , that worked.

To get this working:

  1. reset your package.json to the older state and do a yarn install to bring packages in node_modules back down (otherwise upgrading will falsely detect that it can't upgrade since it's already latest
  2. delete Podfile.lock
  3. re-run npx react-native upgrade

@1mike12 1mike12 closed this as completed Oct 19, 2021
facebook-github-bot pushed a commit that referenced this issue Mar 17, 2022
Summary:
When upgrading `react-native`, the version `RCT-Folly` defined [here](https://github.com/facebook/react-native/blob/main/third-party-podspecs/RCT-Folly.podspec) can change. If that happens, if you run `pod install` after `yarn install`, you will get a similar error to this:
```
[!] CocoaPods could not find compatible versions for pod "RCT-Folly":
  In snapshot (Podfile.lock):
    RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)

  In Podfile:
    RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)

    React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) was resolved to 0.66.3, which depends on
      RCT-Folly (= 2021.06.28.00-v2)
```

This error occurs because `Cocoapods` does not update pods that point to a local podspec. Locally, you could resolve this issue by running `pod update RCT-Folly --no-repo-update`. On the CI, you have to do a clean checkout (in case you cache the `Pods` folder which we do). All of this makes upgrading `react-native` painful - for the whole community and for us shopify

There are other users who have struggled with this, such as [here](#32423). The suggestion there is to delete `Podfile.lock` which is unnecessary - but it shows that users are confused what to do with this error and is something worth fixing.

To mitigate these issues, `react_native_pods.rb` automatically marks `RCT-Folly` as changed in the [detect_changes_with_podfile method](https://github.com/CocoaPods/Core/blob/master/lib/cocoapods-core/lockfile.rb#L289) from `Pod::Lockfile` if the version in `node_modules/react-native/third-party-podspecs/RCT-Folly.podspec` and `Pods/Local Podspecs/RCT-Folly.podspec.json` mismatch.

Instead of automatically updating the local podspec (in `Pods/Local Podspecs` directory) we could also:
a) integrate `RCT-Folly` as a local pod (such as `React-Core` and others)
b) integrate `RCT-Folly` as an external dependency (going through Cocoapods' centralized repository)

I don't have enough context on why `RCT-Folly` is bundled the way it is, so I am open to suggestions here.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Fixed] - Fix `pod install` when `RCT-Folly` version has been updated.

Pull Request resolved: #32659

Test Plan:
I have created a [repository](https://github.com/fortmarek/react-native-upgrade-reproduction) where you can reproduce the issue. You can simply:
1) clone the repo (`git clone https://github.com/fortmarek/react-native-upgrade-reproduction`)
2) Run `yarn install && cd ios && pod install`
3) Change `react-native` version in `package.json` to `0.66.3`
4) Run again `yarn install && pod install`
5) Observe error

To test the fix, you can then:
1) copy-paste the `react_native_pods.rb` file from this branch to `react-native-upgrade-reproduction/node_modules/scripts/react_native_pods.rb`
2) run `pod install` again

This time, the `pod install` command should succeed.

Reviewed By: sota000

Differential Revision: D32720758

Pulled By: cortinico

fbshipit-source-id: 940db9c9f0530f896e47b676dec46bc93cea0085
@kennyledet
Copy link

kennyledet commented Mar 25, 2022

Removing Podfile.lock and running pod deintegrate before pod update helped

@mojvan
Copy link

mojvan commented Sep 15, 2022

[!] CocoaPods could not find compatible versions for pod "React-RCTAnimation":
In Podfile:
React-RCTAnimation (from ../node_modules/react-native/Libraries/NativeAnimation)

Specs satisfying the React-RCTAnimation (from ../node_modules/react-native/Libraries/NativeAnimation) dependency were found, but they required a higher minimum deployment target.

In my case I deleted pods folder and podfile.lock file also updated the ios version from 11.0 to 14.0 in podfile and it worked for me.

@facebook facebook locked as resolved and limited conversation to collaborators Oct 19, 2022
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Triage 🔍 Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants