react-native: Unable to find a specification for `Folly` depended upon by `React/CxxBridge`

Description

What I did:

I updated React Native to the latest version v0.45.1.

My package.json

"dependencies": {
		"react": "16.0.0-alpha.12",
		"react-native": "0.45.1",
		"react-native-vector-icons": "^4.1.1"
	},

What You Expect to Happen:

I expect to be able to build my iOS project without any errors.

What Actually Happened:

I have hundreds of errors in Xcode when building my project:

no such file or directory: ‘node_modules/react-native/React/Modules/JSCSamplingProfiler.m’ no such file or directory: ‘node_modules/react-native/React/Base/RCTBatchedBridge.m’ …

Because of this breaking change (May 2017 Release Notes):

If you are using Cocoapods, you will have to update your Podfile by adding a dependency of ‘BatchedBridge’ or ‘CxxBridge’ to the React subspec depending on your choice.

I added CxxBridge to my Podfile:

pod 'React', :path => '../node_modules/react-native', :subspecs => [
  'Core',
  'jschelpers',
  'cxxreact',
  'CxxBridge',
  'RCTText',
  'RCTNetwork',
  'RCTWebSocket', # needed for debugging
  'RCTActionSheet',
  'RCTAnimation',
  'RCTImage' ]

And when I run pod update or pod install I get:

[!] Unable to find a specification for Follydepended upon byReact/CxxBridge``

If I add BatchedBridge to my Podfile I get:

[!] Unable to find a specification for Follydepended upon byReact/jschelpers``

Solution

I am at a loss here. I need to get the latest version of React Native to build. I have no idea what Folly is or why it seems like it’s a dependency of a dependency. Does anyone know how to resolve this?

I’ve tried pod install --repo-update, which also does not work.

Additional Information

  • React Native version: 0.45.1
  • Platform: iOS
  • Development Operating System: macOS
  • Build tools: Xcode, iOS 10

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 3
  • Comments: 27 (7 by maintainers)

Most upvoted comments

i wanted to learn react native and build something with it but instead i am debugging pod install errors

If you follow the link to the rev in the release notes, you’ll see some additional instructions. You need to make some changes to your Podfile to add the third party CxxBridge dependencies. See https://github.com/mhorowitz/native-navigation-boilerplate/blob/master/ios/Podfile#L12-L14 for an example.

@mhorowitz instead of closing the issue couldn’t you update react-native documentation ?

If i follow the documentation here : https://facebook.github.io/react-native/docs/integration-with-existing-apps.html I expect everything to work right out of the box when copying/pasting the podfile, i shouldn’t have to google my error and go into a github issue to have the pods install properly.

This is not user friendly at all and should in my opinion be fixed (in the documentation i mean).

Description What I did: Followed the Integration with Existing Apps guide from https://facebook.github.io/react-native/docs/integration-with-existing-apps.html

package.json

{
  "name": "ReactExample",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start"
  },
  "dependencies": {
    "react": "16.2.0",
    "react-native": "0.53.3"
  }
}

Podfile:

source 'https://github.com/CocoaPods/Specs.git'

# Required for Swift apps
platform :ios, '8.0'
use_frameworks!

# The target name is most likely the name of your project.
target 'ReactExample' do

  # Your 'node_modules' directory is probably in the root of your project,
  # but if not, adjust the `:path` accordingly
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge', # Include this for RN >= 0.47
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # needed for debugging
    # Add any other subspecs you want to use in your project
  ]
  # Explicitly include Yoga if you are using RN >= 0.42.0
  pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga"

  # Third party deps podspec link
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

end

What You Expect to Happen: I expect to install all dependencies from Podfile. I expect to be able to build my iOS project without any errors.

What Actually Happened:

pod install
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
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`
Fetching podspec for `React` from `../node_modules/react-native`
Fetching podspec for `yoga` from `../node_modules/react-native/ReactCommon/yoga`
[!] Unable to find a specification for `boost-for-react-native` depended upon by `Folly`

Additional Information React Native: 0.53.3 React: 16.2.0 Platform: iOS 11.2 Development Operating System: macOS 10.12.6 Build tools: Xcode 9.2 pod: 1.4.0

@mhorowitz I followed this additional instructions. Now getting build error in limits file not found in folly library.

I had recently updated to cocoa pods 1.5.0 when I started to get this error.

After trying a bunch of things here, I realized that I just needed to run ‘pod repo update’ again, and it was all resolved for me. RN 54.4

The problem described in this issue is that when using the CxxBridge with CocoaPods, the third-party dependency pods need to be explicitly included in the Podfile. There’s an example of this here: https://github.com/mhorowitz/native-navigation-boilerplate/blob/0cb090c6d67ffcb3b47b51e2f06a4253635ef797/ios/Podfile#L13-L16

There’s also conversation in this thread about another issue with CocoaPods and the CxxBridge which is captured in issue https://github.com/facebook/react-native/issues/14326. If you are seeing build-time issues with #import or #include files, please comment there.

@mhorowitz I was use CxxBridge with React native 0.49.5 and I get below error when i compiler my xcode project Include of non-modular header inside framework module ‘yoga.YGNodeList’: ‘/Users/XXXPods/Folly/folly/portability/stdio.h’ image my podfile setting

pod 'yoga', :path => react_native_path + '/ReactCommon/yoga'

# Third party deps
pod 'DoubleConversion', :podspec => react_native_path + '/third-party-podspecs/DoubleConversion.podspec'
pod 'GLog', :podspec => react_native_path + '/third-party-podspecs/GLog.podspec'
pod 'Folly', :podspec => react_native_path + '/third-party-podspecs/Folly.podspec'

# You don't necessarily need all of these subspecs, but this would be a typical setup.
pod 'React', :path => react_native_path, :subspecs => [
'Core',
'CxxBridge',
'RCTText',
'RCTNetwork',
'RCTWebSocket', # needed for debugging
'RCTImage',
'RCTNetwork',
# Add any other subspecs you want to use in your project
'DevSupport'
]

my react native setting

“dependencies”: { “react”: “16.0.0-beta.5”, “react-native”: “0.49.5” }, “devDependencies”: { “babel-jest”: “21.2.0”, “babel-preset-react-native”: “4.0.0”, “jest”: “21.2.1”, “react-test-renderer”: “16.0.0-beta.5” }, “jest”: { “preset”: “react-native” }

what can i do with this ? can you give me some suggesting?

xcode version : Version 9.1 (9B55) mac os: 10.12.6 sierra

thanks

This is a known problem, see issue #14326. The fix is not in react-native 0.45.1. That version will not work. You will need to build from master, or some other version past https://github.com/facebook/react-native/commit/f3f44eee59e8991e197c854e5fee719105c045cd which contains the fix.

There’s a separate bug which requires use_frameworks! in your Podfile for compilation to succeed. I’m still working on that.

I am using “react-native”: “^0.45.1”, and “react”: “^16.0.0-alpha.12”, which doesn’t include the commit f3f44ee. screen shot 2017-06-21 at 11 34 07 am