From 8954e3884e32c7af60df9782e5a24eb656e2a1f0 Mon Sep 17 00:00:00 2001 From: Thorben Primke Date: Tue, 13 Mar 2018 09:35:20 -0700 Subject: [PATCH] [Android] Fixes Up the Gradle Version And RN Maven Path Summary: I believe starting with RN 21 (maybe), the dependencies are no longer on maven / mavencentral but instead you reference them from the local node_modules folder. Second in order to make the Android lib project work with AS, we have to bump the gradle version. It now matches the version in the RN hello world project. : --- templates/android.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/templates/android.js b/templates/android.js index fa7e4c3..e22b577 100644 --- a/templates/android.js +++ b/templates/android.js @@ -7,7 +7,9 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:1.3.1' + // Matches the RN Hello World template + // https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/local-cli/templates/HelloWorld/android/build.gradle#L8 + classpath 'com.android.tools.build:gradle:2.2.3' } } @@ -29,6 +31,12 @@ android { } repositories { + maven { + // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm + // Matches the RN Hello World template + // https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/local-cli/templates/HelloWorld/android/build.gradle#L21 + url "$projectDir/../node_modules/react-native/android" + } mavenCentral() }