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 by
React/CxxBridge``
If I add BatchedBridge
to my Podfile I get:
[!] Unable to find a specification for
Follydepended upon by
React/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)
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.htmlpackage.json
Podfile:
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:
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’ my podfile setting
my react native setting
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.