Skip to content

Instantly share code, notes, and snippets.

@cpojer
Last active September 26, 2023 14:19
Show Gist options
  • Save cpojer/38a91f90614f35769e88410e3a387b48 to your computer and use it in GitHub Desktop.
Save cpojer/38a91f90614f35769e88410e3a387b48 to your computer and use it in GitHub Desktop.

🏗 Build from Source

  • Clone this repository git clone git@github.com:facebook/react-native.git.
  • Change the react-native field in react-native/template/package.json to the absolute path of the react native repo, for example: "react-native": "file:///Users/username/react-native".
  • Run npx react-native init TestApp --template file:///Users/username/react-native (If you don't have npx, run brew install npm).

Switch into the new project: cd TestApp

A number of manual steps have to be done for developing React Native from source:

  • Change implementation "com.facebook.react:react-native:+" to implementation project(':ReactAndroid') in android/app/build.gradle.
  • In android/settings.gradle, add:
include ':ReactAndroid'

project(':ReactAndroid').projectDir = new File(
    rootProject.projectDir, '../node_modules/react-native/ReactAndroid')
  • Add classpath 'de.undercouch:gradle-download-task:3.4.3' under dependencies in android/build.gradle.
  • Run react-native run-android which should now build and install the app on a connected device/emulator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment