From cc7318c8e25dbd78affa2acfcb81f2faa000f347 Mon Sep 17 00:00:00 2001 From: Gerardo Pacheco Date: Wed, 7 Dec 2022 16:55:45 +0100 Subject: [PATCH] =?UTF-8?q?[Gutenberg]=C2=A0-=20React=20Native=200.69.4=20?= =?UTF-8?q?Upgrade=20(#17066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove hermes-mirror in favor of react-native-mirror having both hermes and react native binaries. It also comments out excluding the hermes debug libraries * Exclude com.facebook.fbjni from Gutenberg Mobile binary * Exclude fabricjni.so * Remove hermes-mirror in favor of react-native-mirror having both hermes and react native binaries. It also comments out excluding the hermes debug libraries * Exclude com.facebook.fbjni from Gutenberg Mobile binary * Fix Soloader version to fix issue with instrumented tests * React Native Upgrade - Avoid duplicated classes * Remove unneeded code * Update gutenberg-mobile tag to 1.86.0-alpha1 * Fix typo in Gutenberg tag reference * Update gutenberg tag Co-authored-by: Derek Blank --- WordPress/build.gradle | 15 ++++++--------- build.gradle | 2 +- libs/editor/build.gradle | 30 ++++++++++++++++++++++-------- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/WordPress/build.gradle b/WordPress/build.gradle index c7bde6f4c78b..eb36c9232ef9 100644 --- a/WordPress/build.gradle +++ b/WordPress/build.gradle @@ -29,12 +29,6 @@ repositories { includeGroup "com.automattic.tracks" } } - maven { - url "https://a8c-libs.s3.amazonaws.com/android/hermes-mirror" - content { - includeGroup "org.wordpress-mobile" - } - } maven { url "https://a8c-libs.s3.amazonaws.com/android/react-native-mirror" content { @@ -269,10 +263,13 @@ android { // MPAndroidChart uses androidX - remove this line when we migrate everything to androidX exclude 'META-INF/proguard/androidx-annotations.pro' - // Exclude React Native's JSC and Hermes debug binaries + // Exclude React Native's JSC and Fabric JNI exclude '**/libjscexecutor.so' - exclude '**/libhermes-inspector.so' - exclude '**/libhermes-executor-debug.so' + exclude '**/libfabricjni.so' + + // Avoid React Native's JNI duplicated classes + pickFirst '**/libc++_shared.so' + pickFirst '**/libfbjni.so' pickFirst 'META-INF/-no-jdk.kotlin_module' diff --git a/build.gradle b/build.gradle index 6703d6663b7d..91c268b51d9c 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ ext { automatticRestVersion = '1.0.8' automatticStoriesVersion = '2.0.0' automatticTracksVersion = '2.2.0' - gutenbergMobileVersion = 'v1.85.1' + gutenbergMobileVersion = 'v1.86.0-alpha1' wordPressAztecVersion = 'v1.6.2' wordPressFluxCVersion = '2.6.0' wordPressLoginVersion = '1.0.0' diff --git a/libs/editor/build.gradle b/libs/editor/build.gradle index 9bcb8a2b8db5..6cb550530607 100644 --- a/libs/editor/build.gradle +++ b/libs/editor/build.gradle @@ -21,16 +21,9 @@ repositories { includeGroup "com.facebook.react" } } - maven { - url "https://a8c-libs.s3.amazonaws.com/android/hermes-mirror" - content { - includeGroup "org.wordpress-mobile" - } - } google() mavenCentral() maven { url "https://www.jitpack.io" } - maven { url "https://a8c-libs.s3.amazonaws.com/android/hermes-mirror" } } android { @@ -74,10 +67,31 @@ dependencies { strictly wordPressAztecVersion } } + + // Forcing version due to https://github.com/facebook/SoLoader/issues/94 + // To be removed with React Native 0.70+ + implementation("com.facebook.soloader:soloader") { + version { + strictly '0.10.4' + } + } + + implementation 'com.facebook.fresco:fresco:2.5.0' + implementation 'com.facebook.fresco:imagepipeline-okhttp3:2.5.0' + implementation 'com.facebook.fbjni:fbjni:0.2.2' + implementation 'com.facebook.react:hermes-engine:0.69.4:release@aar' + implementation 'com.facebook.react:react-native:0.69.4:release@aar' + // This dependency will be substituted if the `local-builds.gradle` file contains // `localGutenbergMobilePath`. Details for this can be found in the `settings.gradle` file. - implementation "$rootProject.gradle.ext.gutenbergMobileBinaryPath:$rootProject.ext.gutenbergMobileVersion" + implementation ("$rootProject.gradle.ext.gutenbergMobileBinaryPath:$rootProject.ext.gutenbergMobileVersion") { + exclude module: 'hermes-engine' + exclude module: 'react-native' + } + // Required Aztec dependencies (they should be included but Jitpack seems to be stripping these out) + implementation "org.jsoup:jsoup:$jsoupVersion" + implementation "org.wordpress:utils:$wordPressUtilsVersion" implementation "androidx.appcompat:appcompat:$androidxAppcompatVersion"