2

After installing Nuclide on Atom, Watchman and Buck, I've tried to start working with Buck, but due to limited information on how to start using Buck with React Native, I've been having trouble with my project setup.

What I've done so far:

  1. Initialize template react-native project

    $ react-native init MyProject

  2. Create empty Buck config file

    $ touch .buckconfig

  3. Initialize Buck template for iOS (to have a starting point)

    $ buck quickstart --type -ios --dest-dir .

  4. Running the demo app from Buck quickstart

    $ buck install --run demo_app_ios

  5. Then I changed the settings on the BUCK file to point to the initial React Native project from step 1. And I also deleted all the files generated from the Buck template (except the BUCK file of course)

  6. When I try to build with buck I get the following error:

    fatal error: 'RCTRootView.h' file not found

This is due to Buck not finding the React Native dependencies. I've been trying to add the dependencies in the BUCK file with the directives apple_library() and prebuilt_cxx_library() with no luck.

If somebody can tell me if I'm on the right track, or give me any pointers on how to proceed with my setup, it would be much appreciated

Gianni Carlo
  • 2,452
  • 1
  • 15
  • 18
  • You are certainly on the right track. I'm trying to do something similar with an Android application right now, but I'm actually running into other issues with the RN packager. – sdwilsh Apr 11 '16 at 15:32
  • Are you specifying public headers as appropriate with those third-party dependencies? – sdwilsh Apr 11 '16 at 15:33

1 Answers1

0

I've done it like your step, but it works.

  1. Initialize template react-native project.
  2. $react-native init MyProject Creates an empty Buck config file.
  3. $touch .buckconfig Initialize Buck template for iOS (as starting point)

    $ buck quickstart --type ios --dest-dir /Volumes/BOOTCAMP/ReactNative/MyFirstRN/ $ buck quickstart --type android --dest-dir /Volumes/BOOTCAMP/ReactNative/MyFirstRN/

Andre Hofmeister
  • 3,185
  • 11
  • 51
  • 74
  • my focus has been shifted to ops related work so I haven't had time to retake this. I''ll try it out these days and see if it works and I'll mark your answer correct if that's the case – Gianni Carlo Nov 15 '16 at 17:06