Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

[Android] Make sure we use the react-native version in node_modules

Saúl Ibarra Corretgé52da5010ccae
diff --git a/android/build.gradle b/android/build.gradle
index 868d7b9bdd..dd4303bca2 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -23,6 +23,21 @@ allprojects {
maven { url "$rootDir/../node_modules/react-native/android" }
}
+ // Make sure we use the react-native version in node_modules and not the one
+ // published in jcenter / elsewhere.
+ configurations.all {
+ resolutionStrategy {
+ eachDependency { DependencyResolveDetails details ->
+ if (details.requested.group == 'com.facebook.react'
+ && details.requested.name == 'react-native') {
+ def file = new File("$rootDir/../node_modules/react-native/package.json")
+ def version = new groovy.json.JsonSlurper().parseText(file.text).version
+ details.useVersion version
+ }
+ }
+ }
+ }
+
// Third-party react-native modules which Jitsi Meet SDK for Android depends
// on and which are not available in third-party Maven repositories need to
// be deployed in a Maven repository of ours.