From c3ce62cc91f822e890715f166a3b431d6bdd7729 Mon Sep 17 00:00:00 2001 From: "shah.faizal" Date: Mon, 7 Nov 2022 20:21:07 +0530 Subject: [PATCH] Changes done to adopt the latest Facebook fix provided https://github.com/facebook/react-native/issues/35210 --- example/android/app/build.gradle | 18 ++++-------------- example/android/build.gradle | 8 ++++++++ example/android/gradle.properties | 1 - example/package.json | 2 +- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 7efd471..8f6e579 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -108,16 +108,6 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } - packagingOptions { - pickFirst 'lib/armeabi-v7a/libfbjni.so' - pickFirst 'lib/arm64-v8a/libc++_shared.so' - pickFirst 'lib/arm64-v8a/libfbjni.so' - pickFirst 'lib/x86_64/libfbjni.so' - pickFirst 'lib/x86/libfbjni.so' - pickFirst 'lib/x86/libc++_shared.so' - pickFirst 'lib/x86_64/libc++_shared.so' - pickFirst 'lib/armeabi-v7a/libc++_shared.so' - } defaultConfig { applicationId "com.example" @@ -168,10 +158,10 @@ android { dependencies { if (enableHermes) { - //noinspection GradleDynamicVersion - implementation("com.facebook.react:hermes-engine:+") { // From node_modules - exclude group:'com.facebook.fbjni' - } + def hermesPath = "../../node_modules/hermes-engine/android/"; + debugImplementation files(hermesPath + "hermes-debug.aar") + releaseImplementation files(hermesPath + "hermes-release.aar") + } else { implementation jscFlavor } diff --git a/example/android/build.gradle b/example/android/build.gradle index 1534233..89e09ba 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -20,7 +20,15 @@ buildscript { } } +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()) + allprojects { + configurations.all { + resolutionStrategy { + // Remove this override in 0.65+, as a proper fix is included in react-native itself. + force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION + } + } repositories { mavenLocal() mavenCentral() diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 4adf037..2f5c4e8 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -16,7 +16,6 @@ # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true -org.gradle.jvmargs=-Xmx2048m android.useAndroidX=true android.enableJetifier=true MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore diff --git a/example/package.json b/example/package.json index 8170228..976653c 100644 --- a/example/package.json +++ b/example/package.json @@ -13,7 +13,7 @@ "js-sha512": "^0.8.0", "payu-non-seam-less-react": "^3.0.0", "react": "16.13.1", - "react-native": "^0.64.2" + "react-native": "^0.64.4" }, "devDependencies": { "@babel/core": "7.11.5",