Please follow Facebooks guide for getting started
!!IMPORTANT Developing React Native projects requires:
- Java 1.7 or later (for android)
- Git
- npm v3
- Node 4 or greater. (I use node 5.9.1 and it works)
To manage node versions you can use n
If you already have installed npm v2, and want to run npm v3 alongside npm v2 you can install npm3.
Development for android devices requires the Android SDK, download Android Studio or the Android SDK.
As an alternative you can also use the Genymotion emulator (skip step 1 and 2).
In general the Genymotion emulator has better performance then the one provided by the Android SDK and it is easier to set up. It does however integrate differently with the Android Device Bridge (ADB), and therefore requires some extra set up to get live-reloading.
The setup for windows was more tedious than on OSX, we therefore recommend using OSX if possible. Notes we took from our troubleshooting during the setup-process on windows and OSX can be found here;
- Ensure that you got the Android SDK installed and ANDROID_HOME pointing to the SDK.
- Configure the SDK, download these packages with API-level 23 or higher;
- Android SDK tools
- Android SDK Platform-tools
- Android SDK Build-tools
- SDK Platform
- Intel x86 Atom_64 System Image
- Intel x86 Atom System Image
- Local Maven repository for Support Libraries
- Configure an emulator image (Tip: Set Back Camera to Webcam to be able to take pictures during the workshop)
- Start the emulator
- Clone the repository;
git clone [email protected]:bekk/react-native-workshop.git
- Run
npm install && npm install react-native-cli -g
to install dependencies
- Run
react-native start
- Run
react-native run-android
in another shell, if this fails trycd android && ./gradlew installDebug
- Verify that the app is running in the emulator
If you have any trouble check this
- Run
bash android/run.sh
, this checks your configuration and starts react-native - Verify that the app is running in the emulator
If you have any trouble check this
Devlopment for IOS devices requires XCode (>7.x.x) to be installed, find it in the App Store.
- Clone the repository;
git clone [email protected]:bekk/react-native-workshop.git
- Run
npm install && npm install react-native-cli -g
to install dependencies - Run
react-native run-ios
- Verify that the app is running in the simulator
If steps 3 returns an error, try starting XCode and start an emulator before"
If you get the following error:
ld: library not found for -lRCTCamera
You need to install an additional dependency:
npm install react-native-camera@https://github.com/lwansbrough/react-native-camera.git --save