react-native-mmkv: Android crash on 1.2.5 (1.1.6 downgrade works)

Crash on startup on Android after upgrading to 1.2.5. Tried both with and without Hermes. Downgrade fixed it.

08-17 13:24:52.755 10097 10097 F DEBUG   : Build fingerprint: 'samsung/beyond1lteeea/beyond1:11/RP1A.200720.012/G973FXXSBFUF3:user/release-keys'
08-17 13:24:52.755 10097 10097 F DEBUG   : Revision: '26'
08-17 13:24:52.755 10097 10097 F DEBUG   : ABI: 'arm64'
08-17 13:24:52.755 10097 10097 F DEBUG   : Timestamp: 2021-08-17 13:24:52+0200
08-17 13:24:52.755 10097 10097 F DEBUG   : pid: 8714, tid: 10036, name: create_react_co  >>> com.themobilecompany.delijn <<<
08-17 13:24:52.755 10097 10097 F DEBUG   : uid: 10879
08-17 13:24:52.756 10097 10097 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x2
08-17 13:24:52.756 10097 10097 F DEBUG   : Cause: null pointer dereference
08-17 13:24:52.756 10097 10097 F DEBUG   :     x0  000000000006800b  x1  000000709d4984d8  x2  00000072dee54508  x3  ffffffff9ee5c111
08-17 13:24:52.756 10097 10097 F DEBUG   :     x4  0027ab73c5000000  x5  000000705e543ae4  x6  000000743690f000  x7  0000000001f2e366
08-17 13:24:52.756 10097 10097 F DEBUG   :     x8  01012aa413b4937a  x9  01012aa413b4937a  x10 0000000000000000  x11 01012aa413b4937a
08-17 13:24:52.756 10097 10097 F DEBUG   :     x12 0000000000000018  x13 00000000611b9c84  x14 0028210ae675c86c  x15 000014be3f137182
08-17 13:24:52.756 10097 10097 F DEBUG   :     x16 000000705e7f9bb8  x17 000000742f50ff10  x18 0000007060c48000  x19 00000071aeee1560
08-17 13:24:52.756 10097 10097 F DEBUG   :     x20 000000709d498758  x21 0000000000000000  x22 000000709d4988b0  x23 000000716eebe6a0
08-17 13:24:52.756 10097 10097 F DEBUG   :     x24 000000716eebe6b0  x25 0000000000000002  x26 000000709d49a000  x27 0000000000000000
08-17 13:24:52.756 10097 10097 F DEBUG   :     x28 000000709d498980  x29 000000709d498710
08-17 13:24:52.756 10097 10097 F DEBUG   :     lr  000000705e543bac  sp  000000709d498580  pc  000000705e543bb0  pst 0000000060000000
08-17 13:24:52.830 10097 10097 F DEBUG   : backtrace:
08-17 13:24:52.830 10097 10097 F DEBUG   :       #00 pc 000000000002dbb0  /data/app/~~DS3Ycp2q_TS27axleI9rCA==/com.themobilecompany.delijn-z04o7lHYE5pYmfKr7xFvPQ==/lib/arm64/libhermes.so (facebook::hermes::HermesRuntimeImpl::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)+204) (BuildId: 104108701ea35e3b32f33afab7ef38388a9e99aa)
08-17 13:24:52.830 10097 10097 F DEBUG   :       #01 pc 000000000002a2e8  /data/app/~~DS3Ycp2q_TS27axleI9rCA==/com.themobilecompany.delijn-z04o7lHYE5pYmfKr7xFvPQ==/lib/arm64/libmmkvnative.so (install(facebook::jsi::Runtime&)+144) (BuildId: 1e8957cd4588b8ceca49ec9166600921e517148a)
08-17 13:24:52.830 10097 10097 F DEBUG   :       #02 pc 000000000002b484  /data/app/~~DS3Ycp2q_TS27axleI9rCA==/com.themobilecompany.delijn-z04o7lHYE5pYmfKr7xFvPQ==/lib/arm64/libmmkvnative.so (Java_com_reactnativemmkv_MmkvModule_nativeInstall+80) (BuildId: 1e8957cd4588b8ceca49ec9166600921e517148a)
08-17 13:24:52.830 10097 10097 F DEBUG   :       #03 pc 000000000013eed4  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.830 10097 10097 F DEBUG   :       #04 pc 00000000001357e8  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.830 10097 10097 F DEBUG   :       #05 pc 00000000001ab804  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #06 pc 0000000000326090  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #07 pc 000000000031c278  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+912) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #08 pc 000000000069490c  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+548) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #09 pc 000000000012f994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #10 pc 000000000009e20c  [anon:dalvik-classes2.dex extracted in memory from /data/app/~~DS3Ycp2q_TS27axleI9rCA==/com.themobilecompany.delijn-z04o7lHYE5pYmfKr7xFvPQ==/base.apk!classes2.dex] (com.reactnativemmkv.MmkvModule.install+8)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #11 pc 0000000000694bb0  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+1224) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #12 pc 000000000012f994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #13 pc 0000000000000e6c  [anon:dalvik-classes4.dex extracted in memory from /data/app/~~DS3Ycp2q_TS27axleI9rCA==/com.themobilecompany.delijn-z04o7lHYE5pYmfKr7xFvPQ==/base.apk!classes4.dex] (com.themobilecompany.delijn.DeLijnJSIPackage.getJSIModules+56)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #14 pc 0000000000693694  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1812) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #15 pc 000000000012fa14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #16 pc 00000000003d2564  [anon:dalvik-classes.dex extracted in memory from /data/app/~~DS3Ycp2q_TS27axleI9rCA==/com.themobilecompany.delijn-z04o7lHYE5pYmfKr7xFvPQ==/base.apk] (com.facebook.react.ReactInstanceManager.createReactContext+276)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #17 pc 00000000006942d8  /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+1248) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #18 pc 000000000012f914  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #19 pc 00000000003d2434  [anon:dalvik-classes.dex extracted in memory from /data/app/~~DS3Ycp2q_TS27axleI9rCA==/com.themobilecompany.delijn-z04o7lHYE5pYmfKr7xFvPQ==/base.apk] (com.facebook.react.ReactInstanceManager.access$1100)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #20 pc 0000000000694bb0  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+1224) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #21 pc 000000000012f994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #22 pc 00000000003d1b54  [anon:dalvik-classes.dex extracted in memory from /data/app/~~DS3Ycp2q_TS27axleI9rCA==/com.themobilecompany.delijn-z04o7lHYE5pYmfKr7xFvPQ==/base.apk] (com.facebook.react.ReactInstanceManager$5.run+140)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #23 pc 0000000000693694  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1812) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #24 pc 000000000012fa14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #25 pc 00000000000eb858  /apex/com.android.art/javalib/core-oj.jar (java.lang.Thread.run+8)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #26 pc 0000000000313520  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.230246881315256824)+264) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #27 pc 0000000000680138  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+776) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #28 pc 000000000013eff8  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #29 pc 0000000000135564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #30 pc 00000000001ab7e8  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #31 pc 0000000000567e64  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+460) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #32 pc 00000000005b8154  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1308) (BuildId: fe6bfaf552d16195430b86d57f169733)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #33 pc 00000000000b10e8  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: f85239005a40452d2a5d593676124555)
08-17 13:24:52.831 10097 10097 F DEBUG   :       #34 pc 0000000000050a58  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: f85239005a40452d2a5d593676124555)```

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 20 (11 by maintainers)

Most upvoted comments

While I already spent way too much of my free time on this issue to fix the crash for random people on the internet, I spent some more time on this yesterday and finally fixed it. Check out 1.3.1. 🎉🎉🎉🎉

If you appreciate my efforts, please consider buying me a coffee for my next late-night debug session: ❤️ GitHub sponsors

Also,

  • does this happen in debug or release builds?
  • Do you have a debugger (Flipper, Chrome or even Android Studio/adb) attached?
  • Could you try modifying the node_modules/react-native-mmkv/android/build.gradle file to make it use the -debug.aar instead of the -release.aar?
  • Did you do a complete clean and rebuild before testing?

Again, the example app (RN 0.65.1) works perfectly fine… This crash is really stressing me out

The solution you suggested didn’t work.! Tried cleaning and rebuilding multiple times.

Tried the latest version 1.3.0 with both with and without herms. Application crashes on the startup.

React Native Version: 0.64.2 using React-native-reanimated 2 Attaching log from Android.


com.momental.staging D/SoLoader: init exiting
com.momental.staging D/SoLoader: About to load: libjscexecutor.so
com.momental.staging D/SoLoader: libjscexecutor.so not found on /data/user/0/com.momental.staging/lib-main
com.momental.staging D/SoLoader: libjscexecutor.so found on /data/app/~~QO9JtDC4XoGfVFqsSGsnMA==/com.momental.staging-_2sPlTefbjFj4O9C1VSqzg==/lib/arm64
com.momental.staging D/SoLoader: Not resolving dependencies for libjscexecutor.so
com.momental.staging W/System.err: java.lang.UnsatisfiedLinkError: dlopen failed: library "libjsc.so" not found: needed by /data/app/~~QO9JtDC4XoGfVFqsSGsnMA==/com.momental.staging-_2sPlTefbjFj4O9C1VSqzg==/lib/arm64/libjscexecutor.so in namespace classloader-namespace
com.momental.staging W/System.err:     at java.lang.Runtime.load0(Runtime.java:939)
com.momental.staging W/System.err:     at java.lang.System.load(System.java:1628)
com.momental.staging W/System.err:     at com.facebook.soloader.SoLoader$1.load(SoLoader.java:405)
com.momental.staging W/System.err:     at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:77)
com.momental.staging W/System.err:     at com.facebook.soloader.DirectorySoSource.loadLibrary(DirectorySoSource.java:50)
com.momental.staging W/System.err:     at com.facebook.soloader.ApplicationSoSource.loadLibrary(ApplicationSoSource.java:89)
com.momental.staging W/System.err:     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:860)
com.momental.staging W/System.err:     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:740)
com.momental.staging W/System.err:     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:654)
com.momental.staging W/System.err:     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:634)
com.momental.staging W/System.err:     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:582)
com.momental.staging W/System.err:     at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:297)
com.momental.staging W/System.err:     at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:270)
com.momental.staging W/System.err:     at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87)
com.momental.staging W/System.err:     at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39)
com.momental.staging W/System.err:     at com.momental.MainApplication.onCreate(MainApplication.java:61)
com.momental.staging W/System.err:     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1208)
com.momental.staging W/System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6986)
com.momental.staging W/System.err:     at android.app.ActivityThread.access$1700(ActivityThread.java:274)
com.momental.staging W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2093)
com.momental.staging W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:106)
com.momental.staging W/System.err:     at android.os.Looper.loop(Looper.java:233)
com.momental.staging W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:8010)
com.momental.staging W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
com.momental.staging W/System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
com.momental.staging W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
com.momental.staging E/SoLoader: couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: library "libjsc.so" not found: needed by /data/app/~~QO9JtDC4XoGfVFqsSGsnMA==/com.momental.staging-_2sPlTefbjFj4O9C1VSqzg==/lib/arm64/libjscexecutor.so in namespace classloader-namespace result: 0




com.momental.staging I/ReactNativeJNI: Inspector::Inspector transitioning to initial state RunningDetached
com.momental.staging I/MMKV: <MMKV.cpp:156::initialize> version v1.2.10, page size 4096, arch arm64-v8a
com.momental.staging I/MMKV: <MMKV.cpp:167::initialize> armv8 AES instructions is supported
com.momental.staging I/MMKV: <MMKV.cpp:175::initialize> armv8 CRC32 instructions is supported
com.momental.staging I/MMKV: <MMKV.cpp:198::initializeMMKV> root dir: /data/user/0/com.momental.staging/files/mmkv
    
    --------- beginning of crash
2021-09-05 11:31:26.033 7275-15611/com.momental.staging A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 15611 (create_react_co), pid 7275 (omental.staging) 

I just released 1.3.0 (yay 🎉), can you test if that works for you guys? It does work fine in the Example App (which is on RN 0.65.1)

I can confirm i have the same issue. 1.1.6 works. It stops working from version 1.2.0

Also,

  • does this happen in debug or release builds?
  • Do you have a debugger (Flipper, Chrome or even Android Studio/adb) attached?
  • Could you try modifying the node_modules/react-native-mmkv/android/build.gradle file to make it use the -debug.aar instead of the -release.aar?
  • Did you do a complete clean and rebuild before testing?

Again, the example app (RN 0.65.1) works perfectly fine… This crash is really stressing me out

  • This is happening in debug mode.
  • I haven’t attached any debugger.
  • I’ll check and update here.
  • Yes, I did clean and rebuild multiple times. with and without herms both. But the application still crashes.