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

[iOS][cocoapods] 'RCTAnimation/RCTValueAnimatedNode.h' file not found #13198

Closed
skv-headless opened this issue Mar 29, 2017 · 69 comments
Closed
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@skv-headless
Copy link
Contributor

skv-headless commented Mar 29, 2017

Description

'RCTAnimation/RCTValueAnimatedNode.h' file not found.
in current master https://github.com/facebook/react-native/tree/c233191485ef733aa7a8d4ea5c758b9e6a06964c

  1. related to 28 of march changes. @janicduplessis might help
  2. 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]
@alloy
Copy link
Contributor

alloy commented Mar 29, 2017

podspec test are passed. @alloy do you have ideas how tests could be improved?
Maybe we need to run xcbuild to test?

Nah, we should ideally build all the subspecs, I’ll take a look at how long those take.

@alloy
Copy link
Contributor

alloy commented Mar 29, 2017

@skv-headless Your example fails to build from a fresh clone with different issues than the one this ticket is about. Can you make sure it fails with the exact issue you mention from a fresh clone (so no pod install, no npm install) ?

@alloy
Copy link
Contributor

alloy commented Mar 29, 2017

While enabling full podspec testing I did encounter this failure, which is probably the one you’re referring to:

In file included from /Users/eloy/Code/React/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.m:10:
/Users/eloy/Code/React/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h:12:9: fatal error: 'RCTAnimation/RCTValueAnimatedNode.h' file not found
#import <RCTAnimation/RCTValueAnimatedNode.h>

@skv-headless
Copy link
Contributor Author

Yep. This error. I've updated repo in case it still needed. Are you going to update test script?

@alloy
Copy link
Contributor

alloy commented Mar 29, 2017

Yeah I’ll do that, and then we’ll see how much time it takes to complete on CI.

@alloy
Copy link
Contributor

alloy commented Mar 30, 2017

Pushed #13217

@shrutic
Copy link
Contributor

shrutic commented May 2, 2017

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?

facebook-github-bot pushed a commit that referenced this issue May 9, 2017
Summary:
Fixes issue described #13198

Simpler, compared to #13217

Build no longer fails on not being able to find `RCTAnimation/RCTValueAnimatedNode.h`.
Closes #13785

Differential Revision: D5017734

Pulled By: javache

fbshipit-source-id: e398f74e0fbb1a8f5a43d0a80a4cd3a3587c81b3
@iggyfisk
Copy link

This is fixed as of 7b7d6bb @skv-headless

@nartawak
Copy link

@iggyfisk Is it possible to have a 0.44 fix with this commit ?

@egorkhmelev
Copy link

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:

"scripts": {
  "postinstall": "sed -i '' 's\/#import <RCTAnimation\\/RCTValueAnimatedNode.h>\/#import \"RCTValueAnimatedNode.h\"\/' ./node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h",
  ...rest scripts
}

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

@comigor
Copy link

comigor commented May 22, 2017

@egorkhmelev same for me. ss.header_dir on Podspec didn't solve this issue.

@nartawak
Copy link

nartawak commented May 24, 2017

@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 ?

@guysegal
Copy link

guysegal commented May 24, 2017

this is a blocker for us too.. why is the issue closed? (13217)

@younatics
Copy link

Still get this error in RN 0.45.1

@djhr
Copy link

djhr commented Jun 19, 2017

having this error too in v0.45.1

@stefanengel
Copy link

Getting the error in RN 0.45.1 as well

@younatics
Copy link

Please use this script in package.json script section.

"postinstall": "sed -i '' 's\/#import <RCTAnimation\\/RCTValueAnimatedNode.h>\/#import \"RCTValueAnimatedNode.h\"\/' ./node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h",

It will change #import <RCTAnimation/RCTValueAnimatedNode.h> -> #import "RCTValueAnimatedNode.h

@guysegal
Copy link

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..

@younatics
Copy link

Right. Should be fixed

@guysegal
Copy link

guysegal commented Jul 3, 2017

it seem that this change in RCTNativeAnimatedNodesManager.h does the trick:

before:

screen shot 2017-07-03 at 11 54 59

after:

screen shot 2017-07-03 at 11 55 52

Does this make sense? It's working for me on 0.45.1, without running the patch script

gpeal pushed a commit to airbnb/react-native that referenced this issue Jul 8, 2017
This won't be needed after 0.45. This is necessary for:
facebook#13198
gpeal pushed a commit to airbnb/react-native that referenced this issue Jul 24, 2017
This is only necessary until facebook#13198 is fixed
@jlyonsmith
Copy link

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?

@rodrigoelp
Copy link

That is exactly my line. Doing an application completely in react native is practically unfeasible and most new software is been written in swift (and kotlin)

@p2k
Copy link

p2k commented Mar 19, 2018

Duplicate declaration is inherently prevented by ObjC/clang's #import instruction, except if the headers do exist twice, which is prevented with my proposed approach.

@khadkaPratik
Copy link

khadkaPratik commented Mar 30, 2018

@younatics Your trick worked but i have to remove node_modules folder add the script in package.json and npm install . It worked in my case. Thank you for the trick .

@orta
Copy link
Contributor

orta commented Apr 18, 2018

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

@Abdul-Hannan
Copy link

its sad that even after an year, React-native iOS through Cocoapods is not seamless, you still have to patch around things

@jeanregisser
Copy link
Contributor

What version are you on @Abdul-Hannan?
The project I'm currently working on uses CocoaPods with React Native 0.55.3 without any issue.

@Abdul-Hannan
Copy link

Hello @jeanregisser , I am using 0.55.4

just added the pods as usual, but got this issue

@jeanregisser
Copy link
Contributor

Ok, and what version of CocoaPods?

@Abdul-Hannan
Copy link

I am using COCOAPODS: 1.5.0,
avoided issues by using @orta 's https://github.com/orta/cocoapods-fix-react-native

@react-native-bot
Copy link
Collaborator

Please try again with 0.56.0-rc and let us know if that does not resolve the issue by leaving a comment here.

@chrisballinger
Copy link

chrisballinger commented Jun 18, 2018

I can verify that RN 0.56.0-rc.2 does not resolve the issue.

@rodrigoelp
Copy link

Yup, it has not been fixed. This issue has been on for more than a year.

@keshavkaul
Copy link

keshavkaul commented Jun 28, 2018

@jeanregisser This is still an issue with RN 0.56.0-rc.4

pod 'React', :path => REACT_NATIVE_PATH, :subspecs => [
    'Core',
    'CxxBridge', # Include this for RN >= 0.47
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTAnimation',
    'RCTActionSheet',
    'RCTBlob',
    'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket'
  ]

  # Explicitly include Yoga if you are using RN >= 0.42.0
  pod 'yoga', :path => "#{REACT_NATIVE_PATH}/ReactCommon/yoga"

  # Third party deps podspec link
  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"

facebook-github-bot pushed a commit that referenced this issue Jul 24, 2018
Summary:
@public
This sync includes the following changes:
- **[ca0941fce](facebook/react@ca0941fce)**: Add regression test for Placeholder fallbacks with lifecycle methods (#13254) //<Andrew Clark>//
- **[a32c727f2](facebook/react@a32c727f2)**: Optimize readContext for Subsequent Reads of All Bits (#13248) //<Sebastian Markbåge>//
- **[2b509e2c8](facebook/react@2b509e2c8)**: [Experimental] API for reading context from within any render phase function (#13139) //<Andrew Clark>//
- **[5776fa3fc](facebook/react@5776fa3fc)**: Update www warning shim (#13244) //<Dan Abramov>//
- **[3d3506d37](facebook/react@3d3506d37)**: Include Modes in the component stack (#13240) //<Dan Abramov>//
- **[71b4e9990](facebook/react@71b4e9990)**: [react-test-renderer] Jest matchers for async tests (#13236) //<Andrew Clark>//
- **[2c560cb99](facebook/react@2c560cb99)**: Fix unwinding starting with a wrong Fiber on error in the complete phase (#13237) //<Dan Abramov>//
- **[ead08827d](facebook/react@ead08827d)**: Add more flexibility in testing errors in begin/complete phases (#13235) //<Dan Abramov>//
- **[e4e58343e](facebook/react@e4e58343e)**: Move unstable_yield to main export (#13232) //<Andrew Clark>//
- **[0e235bb8f](facebook/react@0e235bb8f)**: Removed unused state argument in unsubscribe method of <Subscription /> (#13233) //<Mateusz Burzyński>//
- **[236f60872](facebook/react@236f60872)**: Fail tests if toWarnDev() does not wrap warnings in array (#13227) //<Dan Abramov>//
- **[acbb4f93f](facebook/react@acbb4f93f)**: Remove the use of proxies for synthetic events in DEV (#13225) //<Dan Abramov>//
- **[171e0b7d4](facebook/react@171e0b7d4)**: Fix “no onChange handler” warning to fire on falsy values ("", 0, false) too (#12628) //<Nicole Levy>//
- **[606c30aa5](facebook/react@606c30aa5)**: fixed a typo in commentout in ReactFiberUnwindWork.js (#13172) //<Fumiya Shibusawa>//
- **[9f78913b2](facebook/react@9f78913b2)**: Update prettier (#13205) //<Johan Henriksson>//
- **[6d3e26288](facebook/react@6d3e26288)**: Remove unnecessary `typeof` checks (#13196) //<jddxf>//
- **[82c7ca4cc](facebook/react@82c7ca4cc)**: Add component stacks to some warnings (#13218) //<Dan Abramov>//
- **[21ac62c77](facebook/react@21ac62c77)**: Fix a portal unmounting crash for renderers with distinct Instance and Container (#13220) //<Thibault Malbranche>//
- **[d6a0626b3](facebook/react@d6a0626b3)**: Set current fiber during before-mutation traversal (#13219) //<Dan Abramov>//
- **[f9358c51c](facebook/react@f9358c51c)**: Change warning() to automatically inject the stack, and add warningWithoutStack() as opt-out (#13161) //<Dan Abramov>//
- **[467d13910](facebook/react@467d13910)**: Enforce presence or absence of component stack in tests (#13215) //<Dan Abramov>//
- **[43ffae2d1](facebook/react@43ffae2d1)**: Suspending inside a constructor outside of strict mode (#13200) //<Andrew Clark>//
- **[659a29cec](facebook/react@659a29cec)**: Reorganize how shared internals are accessed (#13201) //<Dan Abramov>//
- **[58f3b29d9](facebook/react@58f3b29d9)**: Added SSR/hydration tests for modes, forwardRef, and Profiler (#13195) //<Brian Vaughn>//
- **[1c89cb62f](facebook/react@1c89cb62f)**: Use ReactDebugCurrentFrame.getStackAddendum() in element validator (#13198) //<Dan Abramov>//
- **[e6076ecf4](facebook/react@e6076ecf4)**: Remove ad-hoc forks of getComponentName() and fix it (#13197) //<Dan Abramov>//
- **[32f6f258b](facebook/react@32f6f258b)**: Remove event simulation of onChange events (#13176) //<Philipp Spieß>//
- **[9ca37f843](facebook/react@9ca37f843)**: docs: update comments (#13043) //<Sen Yang>//
- **[f89f25f47](facebook/react@f89f25f47)**: Correct type of `ref` in forwardRef render() (#13100) //<Moti Zilberman>//
- **[7b99ceabe](facebook/react@7b99ceabe)**: Deprecate test utils mock component follow up (#13194) //<Brian Vaughn>//
- **[6ebc8f3c0](facebook/react@6ebc8f3c0)**: Add support for re-entrant SSR stacks (#13181) //<Dan Abramov>//
- **[d64d1ddb5](facebook/react@d64d1ddb5)**: Deprecate ReactTestUtils.mockComponent() (#13193) //<Brian Vaughn>//
- **[e79366d54](facebook/react@e79366d54)**: Link create-subscription doc to GH issue with de-opt explanation (#13187) //<Brian Vaughn>//
- **[1f32d3c6d](facebook/react@1f32d3c6d)**: Test renderer flushAll method verifies an array of expected yields (#13174) //<Brian Vaughn>//
- **[377e1a049](facebook/react@377e1a049)**: Add a test for SSR stack traces (#13180) //<Dan Abramov>//
- **[96d38d178](facebook/react@96d38d178)**: Fix concatenation of null to a warning message (#13166) //<Dan Abramov>//
- **[095dd5049](facebook/react@095dd5049)**: Add DEV warning if forwardRef function doesn't use the ref param (#13168) //<Brian Vaughn>//
- **[566259567](facebook/react@566259567)**: Refactor stack handling (no functional changes) (#13165) //<Dan Abramov>//
- **[ebbd22143](facebook/react@ebbd22143)**: Configure react-test-renderer as a secondary (#13164) //<Brandon Dail>//
- **[ddc91af79](facebook/react@ddc91af79)**: Decrease nested update limit from 1000 to 50 (#13163) //<Andrew Clark>//
- **[3596e40b3](facebook/react@3596e40b3)**: Fix nested update bug (#13160) //<Andrew Clark>//
- **[449f6ddd5](facebook/react@449f6ddd5)**: create a new FeatureFlags file for test renderer on www (#13159) //<Chang Yan>//
- **[f762b3abb](facebook/react@f762b3abb)**: Run react-dom SSR import test in jsdom-less environment (#13157) //<Dan Abramov>//
- **[6f6b560a6](facebook/react@6f6b560a6)**: Renamed selfBaseTime/treeBaseTime Fiber attributes to selfBaseDuration/treeBaseDuration (#13156) //<Brian Vaughn>//
- **[1386ccddd](facebook/react@1386ccddd)**: Fix ReferenceError when requestAnimationFrame isn't defined (#13152) //<Dan Abramov>//
- **[f5779bbc1](facebook/react@f5779bbc1)**: Run server rendering test on bundles (#13153) //<Dan Abramov>//
- **[9faf389e7](facebook/react@9faf389e7)**: Reset profiler timer correctly after errors (#13123) //<Brian Vaughn>//
- **[85fe4ddce](facebook/react@85fe4ddce)**: Fix - issue #12765 / the checked attribute is not initially set on the input (#13114) //<XuMM_12>//
- **[07fefe333](facebook/react@07fefe333)**: Drop handling for ms and O prefixes for CSS transition and animation events. (#13133) //<Rouven Weßling>//
- **[88d7ed8bf](facebook/react@88d7ed8bf)**: React.Timeout -> React.Placeholder (#13105) //<Andrew Clark>//
- **[f128fdea4](facebook/react@f128fdea4)**: Suspending outside of strict trees and async trees (#13098) //<Andrew Clark>//
- **[aa8266c4f](facebook/react@aa8266c4f)**: Prepare placeholders before timing out (#13092) //<Andrew Clark>//
- **[c039c16f2](facebook/react@c039c16f2)**: Fix this in a functional component for ShallowRenderer (#13144) //<Toru Kobayashi>//
- **[64e1921aa](facebook/react@64e1921aa)**: Fix Flow type that event target can be null (#13124) //<Sebastian Markbåge>//
- **[6d6de6011](facebook/react@6d6de6011)**: Add PROFILE bundles for www+DOM and fbsource+RN/RF (#13112) //<Brian Vaughn>//
- **[71a60ddb1](facebook/react@71a60ddb1)**: Add link to another article about React renderers //<Dan Abramov>//
- **[6a530e3ba](facebook/react@6a530e3ba)**: adding check for mousemove (#13090) //<Jason Williams>//
- **[c35a1e748](facebook/react@c35a1e748)**: Fix crash during server render in react 16.4.1. (#13088) //<Dustin Masters>//
- **[076bbeace](facebook/react@076bbeace)**: Fall back to 'setTimeout' when 'requestAnimationFrame' is not called (#13091) //<Flarnie Marchan>//
- **[da5c87bdf](facebook/react@da5c87bdf)**: Fixes children when using dangerouslySetInnerHtml in a selected <option> (#13078) //<Michael Ridgway>//
- **[a960d18bc](facebook/react@a960d18bc)**: eliminate unnecessary do-while loop in renderRoot() (#13087) //<Nathan Quarles>//
- **[5b3d17a5f](facebook/react@5b3d17a5f)**: setting a flag, so that the first movement will have the correct value (#13082) //<Jason Williams>//
- **[b0f60895f](facebook/react@b0f60895f)**: Automatically Profile roots when DevTools is present (#13058) //<Brian Vaughn>//
- **[ae8c6dd53](facebook/react@ae8c6dd53)**: remove some redundant lines (#13077) //<Nathan Quarles>//
- **[0fcf92d06](facebook/react@0fcf92d06)**: Add a link to custom renderer intro article //<Dan Abramov>//
- **[97af3e1f3](facebook/react@97af3e1f3)**:  Do not add additional work to a batch that is already rendering (#13072) //<Andrew Clark>//
- **[4fe6eec15](facebook/react@4fe6eec15)**: Always batch updates of like priority within the same event (#13071) //<Andrew Clark>//
- **[8e87c139b](facebook/react@8e87c139b)**: Remove transitive dependency on fbjs (#13075) //<Dan Abramov>//
- **[aeda7b745](facebook/react@aeda7b745)**: Remove fbjs dependency (#13069) //<Dan Abramov>//
- **[b1b3acbd6](facebook/react@b1b3acbd6)**: Inline fbjs/lib/emptyObject (#13055) //<Dan Abramov>//

Release Notes:
[GENERAL] [FEATURE] [React] - React sync for revisions ae14317...ca0941f

Reviewed By: bvaughn

Differential Revision: D8979192

fbshipit-source-id: 7a14d3b0a253a81d162d7f8c899e99cf6ac4fee4
@pavjacko
Copy link
Contributor

pavjacko commented Aug 10, 2018

try to add this to package.json and run it in your post-install:

"scripts": {
  "fix:ios": "sed -i '' 's/#import <RCTAnimation\\/RCTValueAnimatedNode.h>/#import \"RCTValueAnimatedNode.h\"/' ./node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h"
}

Here is the project template which demonstrates this:
https://www.npmjs.com/package/react-native-vanilla

@ttruongatl
Copy link

I upgraded my react-native to v0.56.0. once I run pod install before building iOS. It works. My solution is

  1. Update react-native@0.56.0
  2. cd ios && pod install
  3. react-native run-ios

@muhammadsr
Copy link

muhammadsr commented Aug 23, 2018

For those who are still experiencing the issue. Try the following:

  1. rm -rf ~/Library/Developer/Xcode/DerivedData/
  2. Inside the ios folder, do
    rm -rf "`pwd`/Pods/"
  3. rm -rf "${HOME}/Library/Caches/CocoaPods"
  4. Run pod install
  5. Open xcworkspace
  6. Product > Clean
  7. Product > Clean Folder (Must hold the option key)
  8. Build

Good luck!

@Dimon70007
Copy link

Dimon70007 commented Dec 6, 2018

I am using COCOAPODS: 1.5.0,
avoided issues by using @orta 's https://github.com/orta/cocoapods-fix-react-native

This library only removes import strings. that were not automatically linked. It's not a solution to remove import code for fixing bugs because it may cause crash

tobiaseisenschenk pushed a commit to tobiaseisenschenk/react-native-selectable-text that referenced this issue Jul 2, 2019
as discussed in facebook/react-native#13198 import paths in differ per RN version
@facebook facebook locked as resolved and limited conversation to collaborators Dec 11, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Dec 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet