react-native-quick-base64: Crashes on Android Start up sometimes on release build

Hello! Thank you for building this awesome library.

I’m using this library in my application, and it’s working fine on iOS, but it sometimes crashes on startup of my app for android release build.

Is this a known problem?

Here’s the stack trace of the crash, hope it helps.

01:26:46.52
DEBUG
backtrace:
01:26:46.52
DEBUG
      #00 pc 000000000005ba2c  /data/app/~~yY065jv4ZakTKp3V_fMcsw==/com.masked-WePDD3HBan4olArPBJi-QQ==/lib/arm64/libhermes.so (BuildId: a3c1bac83dd7ae8092428d75091c23ae6f8c69c7)
01:26:46.52
DEBUG
      #01 pc 000000000006e0e8  /data/app/~~yY065jv4ZakTKp3V_fMcsw==/com.masked-WePDD3HBan4olArPBJi-QQ==/lib/arm64/libhermes.so (BuildId: a3c1bac83dd7ae8092428d75091c23ae6f8c69c7)
01:26:46.52
DEBUG
      #02 pc 00000000000709f0  /data/app/~~yY065jv4ZakTKp3V_fMcsw==/com.masked-WePDD3HBan4olArPBJi-QQ==/lib/arm64/libhermes.so (BuildId: a3c1bac83dd7ae8092428d75091c23ae6f8c69c7)
01:26:46.52
DEBUG
      #03 pc 00000000000342a0  /data/app/~~yY065jv4ZakTKp3V_fMcsw==/com.masked-WePDD3HBan4olArPBJi-QQ==/lib/arm64/libhermes.so (facebook::hermes::HermesRuntimeImpl::setPropertyValue(facebook::jsi::Object&, facebook::jsi::String const&, facebook::jsi::Value const&)+128) (BuildId: a3c1bac83dd7ae8092428d75091c23ae6f8c69c7)
01:26:46.52
DEBUG
      #04 pc 000000000004df94  /data/app/~~yY065jv4ZakTKp3V_fMcsw==/com.masked-WePDD3HBan4olArPBJi-QQ==/lib/arm64/libquickbase64.so (void facebook::jsi::Object::setProperty<facebook::jsi::Function>(facebook::jsi::Runtime&, char const*, facebook::jsi::Function&&)+144) (BuildId: 54db5574dbb5bdf19ead7da238493e90a842cd9b)
01:26:46.52
DEBUG
      #05 pc 000000000004dbec  /data/app/~~yY065jv4ZakTKp3V_fMcsw==/com.masked-WePDD3HBan4olArPBJi-QQ==/lib/arm64/libquickbase64.so (installBase64(facebook::jsi::Runtime&)+332) (BuildId: 54db5574dbb5bdf19ead7da238493e90a842cd9b)
01:26:46.52
DEBUG
      #06 pc 000000000004ee10  /data/app/~~yY065jv4ZakTKp3V_fMcsw==/com.masked-WePDD3HBan4olArPBJi-QQ==/lib/arm64/libquickbase64.so (Java_com_reactnativequickbase64_QuickBase64Module_initialize+32) (BuildId: 54db5574dbb5bdf19ead7da238493e90a842cd9b)

React Native ver: 0.65.1 react-native-quick-base64 ver: 0.1.4 jsruntime: hermes

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 19 (12 by maintainers)

Commits related to this issue

Most upvoted comments

@craftzdog Currently the only way to correctly initialize the JSI Module requires the user to manually install the library (see installation guide for react-native-mmkv) - would you be okay with adding this “complexity”?

Takuya I’m gonna shoot you a PR to fix this in a sec, I might experience the same issue as Julian.

Now that I think about it, it could be a race condition on how the JSI module is injected, if you take a look into MMKV package

https://github.com/mrousavy/react-native-mmkv/blob/master/android/src/main/java/com/reactnativemmkv/MmkvModule.java

The way to access the JS context object is slightly different, he also uses an additional file that is JSI specific for declaring the module

https://github.com/mrousavy/react-native-mmkv/blob/master/android/src/main/java/com/reactnativemmkv/MmkvModulePackage.java

Maybe then react-native guarantees to initialize the JSI modules at the correct time?

Here is also his explanation from RN-EU on how the JSI modules are initialized:

https://youtu.be/Kt--iBUQcww?t=3017

The installation instructions for android, require to override the getJSIModule function as well:

https://github.com/mrousavy/react-native-mmkv/blob/master/INSTALL.md

😃

No, I have not seen this issue

The code looks fine to me, maybe is a device specific issue since it looks like Hermes is having the issue registering the function, maybe @mrousavy can help, his packages seem to be heavily deployed already.

Hi, thanks for the report. That’s interesting. I haven’t ever got the issue at the moment.

According to the stacktrace, I guess the exception happens here: https://github.com/craftzdog/react-native-quick-base64/blob/master/cpp/react-native-quick-base64.cpp#L46

But I have no idea what’s wrong at the moment.

Oscar @ospfranco, have you ever had this issue in your JSI modules?