diff --git a/android/build.gradle b/android/build.gradle index 85b4149915a..f38b14059dd 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -36,22 +36,26 @@ buildscript { allprojects { repositories { - maven { - // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url "$rootDir/../node_modules/react-native/android" + exclusiveContent { + // We get React Native's Android binaries exclusively through npm, + // from a local Maven repo inside node_modules/react-native/. + // (The use of exclusiveContent prevents looking elsewhere like Maven Central + // and potentially getting a wrong version.) + filter { + includeGroup "com.facebook.react" + } + forRepository { + maven { + url "$rootDir/../node_modules/react-native/android" + } + } } maven { // Android JSC is installed from npm url("$rootDir/../node_modules/jsc-android/dist") } - mavenCentral { - // We don't want to fetch react-native from Maven Central as there are - // older versions over there. - content { - excludeGroup "com.facebook.react" - } - } + mavenCentral() google() // The retired "jcenter" repo.