Skip to content

Commit 8954e38

Browse files
author
Thorben Primke
committed
[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. :
1 parent b21602c commit 8954e38

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

templates/android.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ buildscript {
77
}
88
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:1.3.1'
10+
// Matches the RN Hello World template
11+
// https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/local-cli/templates/HelloWorld/android/build.gradle#L8
12+
classpath 'com.android.tools.build:gradle:2.2.3'
1113
}
1214
}
1315
@@ -29,6 +31,12 @@ android {
2931
}
3032
3133
repositories {
34+
maven {
35+
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
36+
// Matches the RN Hello World template
37+
// https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/local-cli/templates/HelloWorld/android/build.gradle#L21
38+
url "$projectDir/../node_modules/react-native/android"
39+
}
3240
mavenCentral()
3341
}
3442

0 commit comments

Comments
 (0)