From a52e68412169db96e51e516465b67d0f3db274d6 Mon Sep 17 00:00:00 2001 From: Thorben Primke Date: Mon, 16 May 2016 23:31:59 -0700 Subject: [PATCH] Updated Embed Into Existing Android App Readme Summary: Motivation: Fix the documentation so that others don't stumble. **Test plan**: Integrating RN into an existing Android app doesn't cause the `ConnectivityManagerCompat` exception anymore. --- The instructions where still pointing at maven central. This updates the dependency and provides instructions on how to reference the local maven folder in `node_modules`. Closes https://github.com/facebook/react-native/pull/7586 Differential Revision: D3309932 fbshipit-source-id: 8e4fc4c0ae5641af886c9d9a0feb1c8172e94fcf --- docs/EmbeddedAppAndroid.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/docs/EmbeddedAppAndroid.md b/docs/EmbeddedAppAndroid.md index e62a4055c..1c336b78c 100644 --- a/docs/EmbeddedAppAndroid.md +++ b/docs/EmbeddedAppAndroid.md @@ -18,9 +18,24 @@ Since React makes no assumptions about the rest of your technology stack, it's e In your app's `build.gradle` file add the React Native dependency: - compile 'com.facebook.react:react-native:0.20.+' + compile "com.facebook.react:react-native:+" // From node_modules -You can find the latest version of the react-native library on [Maven Central](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.facebook.react%22%20AND%20a%3A%22react-native%22). Next, make sure you have the Internet permission in your `AndroidManifest.xml`: +In your project's `build.gradle` file add an entry for the local React Native maven directory: + +``` +allprojects { + repositories { + ... + maven { + // All of React Native (JS, Android binaries) is installed from npm + url "$projectDir/node_modules/react-native/android" + } + } + ... +} +``` + +Next, make sure you have the Internet permission in your `AndroidManifest.xml`: @@ -113,7 +128,7 @@ That's it, your activity is ready to run some JavaScript code. ## Add JS to your app -In your project's root folder, run: +In your app's root folder, run: $ npm init $ npm install --save react-native