Skip to content

Commit

Permalink
Do not bundle libhermes.so or libjsc.so inside the React Native Andro…
Browse files Browse the repository at this point in the history
…id AAR (#33038)

Summary:
Pull Request resolved: #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
  • Loading branch information
cortinico authored and facebook-github-bot committed Feb 3, 2022
1 parent 4cbcb7a commit fa85417
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 6 additions & 0 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 0 additions & 5 deletions template/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,6 @@ android {

}
}

packagingOptions {
pickFirst '**/libhermes.so'
pickFirst '**/libjsc.so'
}
}

dependencies {
Expand Down

0 comments on commit fa85417

Please sign in to comment.