From 6dcf0f0d7dddc4a60537322eec1860448f189ca9 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sat, 5 Nov 2022 22:41:10 +0100 Subject: [PATCH] Fix RN update caused Android build error Spent whole fucking 2 days to figure this out https://github.com/facebook/react-native/issues/35210 --- android/build.gradle | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/android/build.gradle b/android/build.gradle index 6d87c600..59d15377 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -38,6 +38,20 @@ buildscript { allprojects { repositories { + 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" + } + } + } mavenLocal() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm