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

Fix - Unable to build React target after a 'pod install' #17764

Closed
wants to merge 1 commit into from

Conversation

Plo4ox
Copy link

@Plo4ox Plo4ox commented Jan 29, 2018

The following error was thrown:
'string' file not found

To fix the issue, the Yoga's headers importing classes from the STL
have been excluded from the generated umbrella file via the podspec.

Motivation

Integrate React Native into an existing native app.

Test Plan

This has been tested by building a native app using the React pod.

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. cla signed labels Jan 29, 2018
@hramos
Copy link
Contributor

hramos commented Jan 29, 2018

Let's see if we can get someone more familiar with CocoaPods to review this.

@Plo4ox Plo4ox mentioned this pull request Feb 7, 2018
@Titozzz
Copy link
Collaborator

Titozzz commented Feb 8, 2018

This PR should be merged

@hramos
Copy link
Contributor

hramos commented Feb 8, 2018

@Titozzz as I said, this PR needs to be reviewed first.

@facebook facebook deleted a comment from pull-bot Feb 8, 2018
@esakkik
Copy link

esakkik commented Feb 13, 2018

Any updates on the PR

@floriancargoet
Copy link
Contributor

This fix works for me.

@koenpunt
Copy link
Contributor

more familiar with CocoaPods

I think it's more about someone with familiarity with Yoga, who knows what the necessary headers are.

Modifying the podspec works great for me btw. 👍

@koenpunt
Copy link
Contributor

But apart from that; I believe the podspecs are only used for apps who integrate React Native using CocoaPods, right? And since this fix is confirmed to be working for multiple people, I don't think it can't get any worse with this change, because without it, building doesn't work at all.

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Feb 16, 2018
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added Import Failed and removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Feb 17, 2018
@facebook-github-bot
Copy link
Contributor

I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification.

@pull-bot
Copy link

pull-bot commented Feb 17, 2018

Warnings
⚠️

📋 Release Notes - This PR appears to be missing Release Notes.

Generated by 🚫 dangerJS

The following error was thrown:
'string' file not found

To fix the issue, the Yoga's headers importing classes from the STL
have been excluded from the generated umbrella file via the podspec.
@grabbou
Copy link
Contributor

grabbou commented Feb 20, 2018

CC: @ide @emilsjolander @alloy as you were always active in CocoaPods related issues.

I can see the import did fail for some reason, isn't it because of a mandatory rebase you Hector requested last time?

Anyways, please let me know when this lands and whether it has to be cherry-picked. Looks potentially as a serious candidate.

@alloy
Copy link
Contributor

alloy commented Feb 20, 2018

@koenpunt Is correct that this is more an issue of knowing what Yoga headers are indeed public, but otoh these vendored podspecs are also only meant to be used by React Native, so if builds work with only exposing these headers (and potentially not exporting other headers that are also meant to be public) then that seems fine to me 👍

@mkonicek
Copy link
Contributor

mkonicek commented Feb 25, 2018

@LukeDurrant @Plo4ox Thank you so much! 💯Fishhook and RCTAnimation was broken for me too.

@alloy
Copy link
Contributor

alloy commented Feb 25, 2018

I don't understand CocoaPods very well, but the yoga podspec says:

source = { :git => ENV['INSTALL_YOGA_FROM_LOCATION'] || 'https://github.com/facebook/react-native.git' }

Does the podspec use the yoga sources present in node_modules (I already have those after yarn add react-native), or fetch the same sources from GitHub?

Because of the way the podspec setup has been chosen in RN’s case (that is, multiple podspecs, but none in a spec repo) there are some chicken and egg problems when linting the specs. That env variable is to make that case work, as such you can ignore it for normal usage.

In your normal usage case, the source is indeed technically fetched from GitHub, but CP doesn’t actually fetch it again, it has a local cache from where it will unpack the same source. So it really doesn’t matter in the end.

Indeed, I meant not using CocoaPods for adding React Native to existing apps, and doing that manually. The advantage would be less moving pieces so less things that can break (it was broken in React Native 0.53 and fixed by this PR). However, the disadvantage of having to add all sources manually might actually be worse for developers?

I think people should either integrate something completely manually and understand all of the build system or leave all of it up to a manager, the combination would lead to more confusion imo.

@alloy
Copy link
Contributor

alloy commented Feb 25, 2018

Thank you so much! 💯Fishhook and RCTAnimation was broken for me too.

I’m still very much in favour of having a RN specific spec-repo with proper podspecs for each of the RN vendored libraries, including the various distinct parts that make up the RN framework (such as RCTAnimation). In naive testing it seemed to work fine to have that spec-repo exist inside the RN repo, so there wouldn’t even be a need for another git repo.

@barbieri
Copy link
Contributor

I'm not using the Animated part, however to build dev menu one needs WebSocket that needs the change:

diff -ruN node_modules/react-native/Libraries/WebSocket/RCTReconnectingWebSocket.m new_node_modules/react-native/Libraries/WebSocket/RCTReconnectingWebSocket.m
--- node_modules/react-native/Libraries/WebSocket/RCTReconnectingWebSocket.m	2018-01-29 08:51:28.000000000 +0100
+++ new_node_modules/react-native/Libraries/WebSocket/RCTReconnectingWebSocket.m	2018-01-29 08:54:01.000000000 +0100
@@ -11,7 +11,7 @@

 #import <React/RCTConvert.h>
 #import <React/RCTDefines.h>
-#import <fishhook/fishhook.h>
+#import <React/fishhook.h>

 #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
 #import <os/log.h>

@Plo4ox could you incorporate that as well?

@Plo4ox
Copy link
Author

Plo4ox commented Feb 27, 2018

@barbieri I don't think that regrouping all the fixes in the same PR is a good thing to do, knowing that there already is a PR that is fixing the issue.
But I don't know, @hramos @alloy @mkonicek @grabbou @koenpunt @shergin @mhorowitz @Kureev @janicduplessis, what do you think, what is the best way to do here ?

Furthermore, I just wanted to do a rebase, but the latest version of react-native in master didn't work...
I have the following error:
Compile RCTFabricUIManagerWrapper: 'folly/folly-config.h' file not found
And to fix the issue, I had to remove the following line: #include <fabric/FabricUIManager.h> from the following file: RCTFabricUIManagerWrapper.mm
As the last commit was pushed a few minutes ago it may be fixed during the next minutes ^^

@barbieri
Copy link
Contributor

@Plo4ox indeed, they can be handled in separate... however I'm amazed how buggy are the podspecs and the cocoapods support. Compared to Android, gradle works like a charm, just need one single line to say the maven url.

Actually, for me I want to use with Swift... but my project is another library/framework, however I can't use React as a framework (it should be one!), thus I need a -Bridging-Header.h, which prevents my library to be exposed as a framework. Again, for Android using Kotlin is as easy and simple as using Java.

@mkonicek
Copy link
Contributor

mkonicek commented Mar 1, 2018

In your normal usage case, the source is indeed technically fetched from GitHub, but CP doesn’t actually fetch it again, it has a local cache from where it will unpack the same source.

@alloy This is very cool!

@rizwankce
Copy link

@Plo4ox we could close this PR as same change is being merged today with the help of #18492

@Plo4ox
Copy link
Author

Plo4ox commented Mar 23, 2018

@rizwankce You are right, it seems that my PR has been deprecated by a new one 😆

@Plo4ox Plo4ox closed this Mar 23, 2018
@fkgozali
Copy link
Contributor

And to fix the issue, I had to remove the following line: #include <fabric/FabricUIManager.h> from the following file: RCTFabricUIManagerWrapper.mm

@Plo4ox: sorry you got this error. The RCTFabricUIManagerWrapper.mm shouldn't have been linked to the existing project since it's experimental and at the very early stage.

I'll talk to my team to get this fixed. Meanwhile, could you help provide the step to repro the error (preferably as a separate issue, tagging me)?

cc @shergin, @hramos

facebook-github-bot pushed a commit that referenced this pull request Sep 11, 2018
Summary:
Fixing error
node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h:12:9: 'RCTAnimation/RCTValueAnimatedNode.h' file not found

I'm integrating react native into an existing app through cocoa pods and similar to other PRs
PR #16192
PR #16271
PR #17764
When integrating with cocoa pods
```
pod 'React', :path => './node_modules/react-native', :subspecs => [
    'Core',
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # needed for debugging
    'RCTImage',
    'RCTWebSocket',
    'BatchedBridge',
    'RCTLinkingIOS',
    'RCTActionSheet',
    'RCTAnimation'
    ]
```
With `RCTAnimation` being the important part for this PR.

Also note without this PR and the other PR's above if anyone is trying to integrate react native into an existing app i.e. through cocoa pods they won't be able too. I think the latest working version is

My app wouldn't build without changing this line

PR #16192
PR #16271
PR #17764

 [IOS] [BREAKING] [PODS] - Fixed RCTAnimation import for integrating with cocoapods
Pull Request resolved: #18050

Differential Revision: D9235162

Pulled By: hramos

fbshipit-source-id: 426daccf8d8952658e262d5a0e4623c72c38542c
hramos pushed a commit that referenced this pull request Sep 11, 2018
Summary:
Fixing error
node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h:12:9: 'RCTAnimation/RCTValueAnimatedNode.h' file not found

I'm integrating react native into an existing app through cocoa pods and similar to other PRs
PR #16192
PR #16271
PR #17764
When integrating with cocoa pods
```
pod 'React', :path => './node_modules/react-native', :subspecs => [
    'Core',
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # needed for debugging
    'RCTImage',
    'RCTWebSocket',
    'BatchedBridge',
    'RCTLinkingIOS',
    'RCTActionSheet',
    'RCTAnimation'
    ]
```
With `RCTAnimation` being the important part for this PR.

Also note without this PR and the other PR's above if anyone is trying to integrate react native into an existing app i.e. through cocoa pods they won't be able too. I think the latest working version is

My app wouldn't build without changing this line

PR #16192
PR #16271
PR #17764

 [IOS] [BREAKING] [PODS] - Fixed RCTAnimation import for integrating with cocoapods
Pull Request resolved: #18050

Differential Revision: D9235162

Pulled By: hramos

fbshipit-source-id: 426daccf8d8952658e262d5a0e4623c72c38542c
gengjiawen pushed a commit to gengjiawen/react-native that referenced this pull request Sep 14, 2018
Summary:
Fixing error
node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h:12:9: 'RCTAnimation/RCTValueAnimatedNode.h' file not found

I'm integrating react native into an existing app through cocoa pods and similar to other PRs
PR facebook#16192
PR facebook#16271
PR facebook#17764
When integrating with cocoa pods
```
pod 'React', :path => './node_modules/react-native', :subspecs => [
    'Core',
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # needed for debugging
    'RCTImage',
    'RCTWebSocket',
    'BatchedBridge',
    'RCTLinkingIOS',
    'RCTActionSheet',
    'RCTAnimation'
    ]
```
With `RCTAnimation` being the important part for this PR.

Also note without this PR and the other PR's above if anyone is trying to integrate react native into an existing app i.e. through cocoa pods they won't be able too. I think the latest working version is

My app wouldn't build without changing this line

PR facebook#16192
PR facebook#16271
PR facebook#17764

 [IOS] [BREAKING] [PODS] - Fixed RCTAnimation import for integrating with cocoapods
Pull Request resolved: facebook#18050

Differential Revision: D9235162

Pulled By: hramos

fbshipit-source-id: 426daccf8d8952658e262d5a0e4623c72c38542c
aleclarson pushed a commit to aleclarson/react-native that referenced this pull request Sep 16, 2018
Summary:
Fixing error
node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h:12:9: 'RCTAnimation/RCTValueAnimatedNode.h' file not found

I'm integrating react native into an existing app through cocoa pods and similar to other PRs
PR facebook#16192
PR facebook#16271
PR facebook#17764
When integrating with cocoa pods
```
pod 'React', :path => './node_modules/react-native', :subspecs => [
    'Core',
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # needed for debugging
    'RCTImage',
    'RCTWebSocket',
    'BatchedBridge',
    'RCTLinkingIOS',
    'RCTActionSheet',
    'RCTAnimation'
    ]
```
With `RCTAnimation` being the important part for this PR.

Also note without this PR and the other PR's above if anyone is trying to integrate react native into an existing app i.e. through cocoa pods they won't be able too. I think the latest working version is

My app wouldn't build without changing this line

PR facebook#16192
PR facebook#16271
PR facebook#17764

 [IOS] [BREAKING] [PODS] - Fixed RCTAnimation import for integrating with cocoapods
Pull Request resolved: facebook#18050

Differential Revision: D9235162

Pulled By: hramos

fbshipit-source-id: 426daccf8d8952658e262d5a0e4623c72c38542c
t-nanava pushed a commit to microsoft/react-native-macos that referenced this pull request Jun 17, 2019
Summary:
Fixing error
node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h:12:9: 'RCTAnimation/RCTValueAnimatedNode.h' file not found

I'm integrating react native into an existing app through cocoa pods and similar to other PRs
PR facebook#16192
PR facebook#16271
PR facebook#17764
When integrating with cocoa pods
```
pod 'React', :path => './node_modules/react-native', :subspecs => [
    'Core',
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # needed for debugging
    'RCTImage',
    'RCTWebSocket',
    'BatchedBridge',
    'RCTLinkingIOS',
    'RCTActionSheet',
    'RCTAnimation'
    ]
```
With `RCTAnimation` being the important part for this PR.

Also note without this PR and the other PR's above if anyone is trying to integrate react native into an existing app i.e. through cocoa pods they won't be able too. I think the latest working version is

My app wouldn't build without changing this line

PR facebook#16192
PR facebook#16271
PR facebook#17764

 [IOS] [BREAKING] [PODS] - Fixed RCTAnimation import for integrating with cocoapods
Pull Request resolved: facebook#18050

Differential Revision: D9235162

Pulled By: hramos

fbshipit-source-id: 426daccf8d8952658e262d5a0e4623c72c38542c
t-nanava pushed a commit to microsoft/react-native-macos that referenced this pull request Jun 17, 2019
Summary:
Fixing error
node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h:12:9: 'RCTAnimation/RCTValueAnimatedNode.h' file not found

I'm integrating react native into an existing app through cocoa pods and similar to other PRs
PR facebook#16192
PR facebook#16271
PR facebook#17764
When integrating with cocoa pods
```
pod 'React', :path => './node_modules/react-native', :subspecs => [
    'Core',
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # needed for debugging
    'RCTImage',
    'RCTWebSocket',
    'BatchedBridge',
    'RCTLinkingIOS',
    'RCTActionSheet',
    'RCTAnimation'
    ]
```
With `RCTAnimation` being the important part for this PR.

Also note without this PR and the other PR's above if anyone is trying to integrate react native into an existing app i.e. through cocoa pods they won't be able too. I think the latest working version is

My app wouldn't build without changing this line

PR facebook#16192
PR facebook#16271
PR facebook#17764

 [IOS] [BREAKING] [PODS] - Fixed RCTAnimation import for integrating with cocoapods
Pull Request resolved: facebook#18050

Differential Revision: D9235162

Pulled By: hramos

fbshipit-source-id: 426daccf8d8952658e262d5a0e4623c72c38542c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Missing Changelog This PR appears to be missing a changelog, or they are incorrectly formatted. Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command.
Projects
None yet
Development

Successfully merging this pull request may close these issues.