From d15ba1b3e28b02aa644ea6d81a57b88f88d5a828 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Mon, 7 Nov 2022 12:18:30 +0000 Subject: [PATCH 1/2] manually set gradle react-native version --- android/app/build.gradle | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 87bbc2c53892..1cca1de54289 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -279,9 +279,11 @@ android { dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) - //noinspection GradleDynamicVersion - implementation "com.facebook.react:react-native:+" // From node_modules - + // Manually set the react-native version to resolve this issue: https://github.com/facebook/react-native/issues/35210 + implementation ("com.facebook.react:react-native") version { + strictly "0.70.4" + } + implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { From 26f9fe6234f534d4a7e6fe4420c831d979888ae0 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Mon, 7 Nov 2022 14:01:23 +0000 Subject: [PATCH 2/2] use existing gradle allProjects to lock RN version --- android/app/build.gradle | 8 +++----- android/build.gradle | 4 ++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 1cca1de54289..87bbc2c53892 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -279,11 +279,9 @@ android { dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) - // Manually set the react-native version to resolve this issue: https://github.com/facebook/react-native/issues/35210 - implementation ("com.facebook.react:react-native") version { - strictly "0.70.4" - } - + //noinspection GradleDynamicVersion + implementation "com.facebook.react:react-native:+" // From node_modules + implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { diff --git a/android/build.gradle b/android/build.gradle index 49fa013fac6b..1eb91727e016 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -42,6 +42,10 @@ allprojects { configurations.all { resolutionStrategy { force 'org.xerial:sqlite-jdbc:3.34.0' + + // Manually set the react-native version to resolve this upstream issue: https://github.com/facebook/react-native/issues/35210 + def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim()) + force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION } } repositories {