Skip to content

Commit

Permalink
Catching missing libjsi.so as librealm.so loads (#4123)
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen committed Dec 21, 2021
1 parent aa9bd0b commit 4b2d627
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
x.x.x Release notes (yyyy-MM-dd)
=============================================================
### Enhancements
* None.
* Catching missing libjsi.so when loading the librealm.so and rethrowing a more meaningful error, instructing users to upgrade their version of React Native.

### Fixed
* <How to hit and notice issue? what was the impact?> ([#????](https://github.com/realm/realm-js/issues/????), since v?.?.?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,14 @@ class RealmReactModule extends ReactContextBaseJavaModule {
private final AssetManager assetManager;

static {
SoLoader.loadLibrary("realm");
try {
SoLoader.loadLibrary("realm");
} catch (UnsatisfiedLinkError err) {
if (err.getMessage().contains("library \"libjsi.so\" not found")) {
throw new LinkageError("This version of Realm JS needs at least React Native version 0.66.0", err);
}
throw err;
}
}

public RealmReactModule(ReactApplicationContext reactContext) {
Expand Down

0 comments on commit 4b2d627

Please sign in to comment.