react-native: [iOS][cocoapods] 'RCTAnimation/RCTValueAnimatedNode.h' file not found
Description
'RCTAnimation/RCTValueAnimatedNode.h' file not found.
in current master https://github.com/facebook/react-native/tree/c233191485ef733aa7a8d4ea5c758b9e6a06964c
- related to 28 of march changes. @janicduplessis might help
- podspec test are passed. @alloy do you have ideas how tests could be improved?
Maybe we need to run
xcbuild
to test?
Reproduction Steps and Sample Code
https://github.com/skv-headless/AwesomeProject - demo project based on this page https://facebook.github.io/react-native/docs/integration-with-existing-apps.html#cocoapods
Solution
It works if change #import <RCTAnimation/RCTValueAnimatedNode.h>
to #import "RCTValueAnimatedNode.h"
Additional Information
- Platform: [iOS]
- Development Operating System: [MacOS]
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 77
- Comments: 69 (18 by maintainers)
Links to this issue
Commits related to this issue
- React.podspec fix for RCTAnimation header issue Summary: Fixes issue described #13198 Simpler, compared to #13217 Build no longer fails on not being able to find `RCTAnimation/RCTValueAnimatedNode.... — committed to facebook/react-native by vjeranc 7 years ago
- Add React Native via Cocoapods. Still not building due to: https://github.com/facebook/react-native/issues/13198 — committed to solium/swift-react-native-hybrid by deleted user 7 years ago
- Add a workaround to package.json to workaround this bug: https://github.com/facebook/react-native/issues/13198 rm -rf node_modules and use yarn to install — committed to solium/swift-react-native-hybrid by deleted user 7 years ago
- This is a weird patch to get RCTAnimation working Found here: https://github.com/facebook/react-native/issues/13198 — committed to JamieRobertson/learn-you-kanji by deleted user 7 years ago
- [Airbnb] Fix RCTValueAnimatedNode import This won't be needed after 0.45. This is necessary for: https://github.com/facebook/react-native/issues/13198 — committed to airbnb/react-native by vjeranc 7 years ago
- [Airbnb] Fix RCTAnimation import This is only necessary until https://github.com/facebook/react-native/issues/13198 is fixed — committed to airbnb/react-native by deleted user 7 years ago
- fix facebook#13198 — committed to evilDave/react-native by deleted user 7 years ago
- fix facebook#13198 — committed to mmiani/react-native by mmiani 7 years ago
- Fix import of React/RCTValueAnimatedNode.h #13198 — committed to iegik/react-native by iegik 7 years ago
- React sync for revisions ae14317...ca0941f Summary: @public This sync includes the following changes: - **[ca0941fce](https://github.com/facebook/react/commit/ca0941fce)**: Add regression test for Pl... — committed to facebook/react-native by hramos 6 years ago
- fix: allow deprecated import path as discussed in https://github.com/facebook/react-native/issues/13198 import paths in differ per RN version — committed to tobiaseisenschenk/react-native-selectable-text by deleted user 5 years ago
For those who still searching for a quick solution. I was able to launch iOS app with RCTAnimation subspec by including following string to my package.json:
React: 16.0.0-alpha.12 ReactNative: 0.45.0-rc.0
Didn’t work for me with above PR which already accepted in 0.45.0-rc.0
I still get this error even in 0.44.0 where the code in RCTNativeAnimatedModule.h is updated from It works if change #import <RCTAnimation/RCTValueAnimatedNode.h> to #import “RCTValueAnimatedNode.h”
as mentioned by the original Bug logger. So the solution did not work for me… Any other recommended solutions?
it seem that this change in RCTNativeAnimatedNodesManager.h does the trick:
before:
after:
Does this make sense? It’s working for me on 0.45.1, without running the patch script
@jeanregisser This is still an issue with RN 0.56.0-rc.4
Same here, please fix this
Still get this error in RN 0.45.1
Hi everyone, I’ve centralized a lot of the CocoaPods issues into a single project which will apply all of the post-install fixes for you, which should simplify integrating React Native with CocoaPods
https://github.com/orta/cocoapods-fix-react-native
There is a common practice that I noticed in quite a few projects that deal with this issue. Here is how it would look like:
You can adjust this to your needs, e.g. if you want to cling to
#import <RCTAnimation/RCTValueAnimatedNode.h>
for whatever reason, then just replace the first and second line appropriately.This “trick” ensures best compatibility with
use_frameworks!
and traditional methods.Still get error with
fishhook.h
andRCTValueAnimatedNode.h
, so I have to change it manually.I got this issue upgrading to react native 0.47.1, any way to resolve it without hacks?
For those who are still experiencing the issue. Try the following:
rm -rf ~/Library/Developer/Xcode/DerivedData/
ios
folder, dorm -rf "`pwd`/Pods/"
rm -rf "${HOME}/Library/Caches/CocoaPods"
pod install
xcworkspace
Good luck!
I think that we should push this up again. Otherwise we will have always kind of
hack
on our projects to make them work withCocoapods
.Thanks!
Please use this script in
package.json
script
section.It will change
#import <RCTAnimation/RCTValueAnimatedNode.h>
->#import "RCTValueAnimatedNode.h
@iggyfisk Is it possible to have a 0.44 fix with this commit ?
this is a blocker for us too… why is the issue closed? (13217)
Did anyone try setting
private_header_files
? We do use that in a few place in the pod config file. I’m pretty sure it’s just a config issue, we should not have to change the import. Sorry about this taking so long to get resolved but we want to make sure we have the right fix.I can verify that RN 0.56.0-rc.2 does not resolve the issue.
I am using COCOAPODS: 1.5.0, avoided issues by using @orta 's https://github.com/orta/cocoapods-fix-react-native
I use this script and it works but it’s not a solution its a patch… Also some of our teammates are working on Windows macines so this script will not work (I know there’s an equivalent for Windows)
The point is that this should be solved the right way without using any hacking…
try to add this to package.json and run it in your post-install:
Here is the project template which demonstrates this: https://www.npmjs.com/package/react-native-vanilla
I’ve asked on the Cocoapods mailing list but I think it is correct to change the import to
#import <React/RCTValueAnimatedNode.h>
.I think this is because
RCTAnimation
is only a subspec and will be built within theReact.framework
when installed with Cocoapods. IfRCTAnimation
would be a full-fledged pod then it would be possible to use#import <RCTAnimation/RCTValueAnimatedNode.h>
.Does anyone tried to investigate real cause of this problem and find proper solution? All approaches mentioned here and in attached PRs do not look legit and almost certainly will not be merged.
@iggyfisk This PR (7b7d6bb) didn’t solve this issue (with RN 0.45.0-rc.0) but this one which is closed yes (13217) !!!
Does someone work again on this issue ?
This is fixed as of https://github.com/facebook/react-native/commit/7b7d6bb1583eada246de17d4c33b5fd37ba8ce0c @skv-headless
Yup, it has not been fixed. This issue has been on for more than a year.
What build is the React Native team planning to put out a fix for this? Now that Swift has been around for a couple years and
use_frameworks!
has become commonplace this seems like it really needs a fix. Maybe a trial branch so that folks can report errors and issues before release?Yeah I’ll do that, and then we’ll see how much time it takes to complete on CI.