Do not bundle libhermes.so or libjsc.so inside the React Native Android AAR (#33038)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33038

While rolling out RN 0.68.x we noticed that `libhermes.so` and `libjsc.so` were included
inside the final .aar we publish to NPM. This forced users (on both old or new arch) to
specify a `pickFirst` directive inside their packaging option (which is unpractical and
risky as the two .so might not be compatible each other if they're coming from
different Hermes/JSC versions).

Changelog:
[Android] [Fixed] - Do not bundle libhermes.so or libjsc.so inside the React Native Android AAR

Reviewed By: ShikaSD

Differential Revision: D33979107

fbshipit-source-id: 0b71d59f210b8bc9903cd0f30ed6e2120aab99e0
This commit is contained in:
Nicola Corti
2022-02-03 17:12:54 +00:00
committed by Andrei Shikov
parent 58eb8b13a0
commit 71548ffd69
2 changed files with 6 additions and 5 deletions
+6
View File
@@ -351,6 +351,12 @@ android {
packagingOptions {
exclude("META-INF/NOTICE")
exclude("META-INF/LICENSE")
// We intentionally don't want to bundle any JS Runtime inside the Android AAR
// we produce. The reason behind this is that we want to allow users to pick the
// JS engine by specifying a dependency on either `hermes-engine` or `android-jsc`
// that will include the necessary .so files to load.
exclude("**/libhermes.so")
exclude("**/libjsc.so")
}
configurations {
-5
View File
@@ -233,11 +233,6 @@ android {
}
}
packagingOptions {
pickFirst '**/libhermes.so'
pickFirst '**/libjsc.so'
}
}
dependencies {