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

'RCTDefines.h' file not found and React (missing) #686

Closed
connercms opened this issue Dec 14, 2017 · 3 comments
Closed

'RCTDefines.h' file not found and React (missing) #686

connercms opened this issue Dec 14, 2017 · 3 comments

Comments

@connercms
Copy link

connercms commented Dec 14, 2017

Issue

I have been following the guide to install for iOS and my build fails with error 'RCTDefines.h' file not found. In Xcode, if I go to Product > Scheme > Edit Scheme > Build, it shows React (missing). I found this issue #541 where @chrisbianca posted a solution that involved adding the React pod to the pod file by adding

pod "Yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
pod 'React', :path => '../node_modules/react-native', :subspecs => [
  'BatchedBridge', # Required For React Native 0.45.0+
  'Core',
  # Add any other subspecs you want to use in your project
]

but this just gives me the error

[!] No podspec found for React in ../node_modules/react-native

My podfile looks like

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'cleantouchmobile' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  #Pods for cleantouchmobile
  # < ---- Tried adding yoga and react pods here
  pod 'Firebase/Core'
  pod 'Firebase/Auth'
  pod 'Firebase/Database'

  target 'cleantouchmobileTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

target 'cleantouchmobile-tvOS' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for cleantouchmobile-tvOS

  target 'cleantouchmobile-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

I can post any other code needed.

Environment

  1. Application Target Platform: IOS
  1. Development Operating System: macOS High Sierra
  1. Build Tools: Xcode
  1. React Native version: 0.51.0
  1. RNFirebase Version: 3.1.1
  1. Firebase Module: Auth, Database
@chrisbianca
Copy link
Contributor

Looks like you're running into the issue caused by some changes in RN 0.50 with how react-native link works. Take a look here for a temporary workaround: #636

@connercms
Copy link
Author

connercms commented Dec 14, 2017

Actually I'm not sure where this issue lies. I will list my steps:

  1. react-native init myApp
  2. cd myApp
  3. npm i --save react-native-firebase
  4. react-native link react-native-firebase
    • Here I get error: command link unrecognized. Make sure that you have run npm install and that you are inside a react-native project. I have definitely just cd into the react native project I just created. Googling this issue, I found a thread where someone said running 'yarn' fixes this for them.
  5. Run 'yarn' - this allows me to run 'react-native link react-native-firebase'
  6. Follow instructions on react native documentation to create podfile and install pods for RN modules I need
  7. Good up to this point. I cd into root of my react-native project to start installing other packages and run 'npm i --save redux-thunk'
  8. I get this output
> [email protected] postinstall /Users/shannons/cleantouchmobile/cleantouchmobile/node_modules/react-native-firebase
> opencollective postinstall

[server error] Cannot load the stats for react-native-firebase – please try again later
                                 ..,::::::::::,..            
                              .,::::::::::::::::::,.         
                           .,:::::::::::::::::::::,.         
                         .:::::::::::,,,,,,,,:::,.           
                        ,::::::::,.                      .   
                       ,:::::::,                       .,,.  
                      ,:::::::.                      .,,,,,. 
                     .:::::::.                       .,,,,,, 
                     :::::::.                        .,,,,,,.
                     :::::::                          ,,,,,,,
                     :::::::                          ,,,,,,,
                     :::::::.                        .,,,,,,.
                     .:::::::.                       .,,,,,, 
                      ,:::::::.                      .,,,,,. 
                       ,:::::::,                       .,,.  
                        ,::::::::,.                      .   
                         .:::::::::::,,,,,,,,:::,.           
                           .,:::::::::::::::::::::,.         
                              .,::::::::::::::::::,.         
                                 ..,::::::::::,..            
                                         

                  Thanks for installing react-native-firebase 🙏
                 Please consider donating to our open collective
                        to help us maintain this package.


   👉  Donate: https://opencollective.com/react-native-firebase/donate

+ [email protected]
added 12 packages, removed 675 packages and updated 206 packages in 8.335s

Now when I open my .xcworkspace in Xcode and go to Product > Scheme > Edit Scheme > Build, React is missing. I can run 'yarn' again and it brings it back, but then after I install another package, ex 'npm i --save redux', it just starts from step 8 again. So to sum it up, first I get 'Command 'link' unrecognized', even though I just created the project moments before and cd into it. Then when I try to install other packages using npm i --save [package], it acts like it is installing react-native-firebase again but deletes other packages and then React is missing inside Xcode. Problem with react-native, npm or RNF?

Node: 8.1.2
npm: 5.6.0
react-native-cli: 2.0.1
react-native: running react-native -v inside the project I just created says 'n/a - not inside a react-native directory'
react-native-firebae: 3.1.1

@connercms
Copy link
Author

connercms commented Dec 14, 2017

Created a new project, followed the steps below

  1. react-native init awesome
  2. cd awesome
  3. react-native -v => react-native-cli: 2.0.1, react-native: 0.51.0
  4. npm i --save redux
  5. react-native -v => react-native-cli: 2.0.1, n/a not inside a react native project directory
  6. npm i
  7. react-native -v => react-native-cli: 2.0.1, react-native: 0.51.0

Seems to be an issue outside this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants