React-native-reanimated: Android app crashes instantly in release mode

Created on 6 Oct 2020  路  4Comments  路  Source: software-mansion/react-native-reanimated

Description

Hey guys ! I have troubles opening my android app in release mode. In fact, it crashes instantly when I open it.

I found this logs in logcat :

2020-10-06 11:33:19.798 13982-14053/? E/AndroidRuntime: FATAL EXCEPTION: create_react_context
    Process: [APP_ID], PID: 13982
    java.lang.NoSuchMethodError: no non-static method "Lcom/facebook/react/turbomodule/core/CallInvokerHolderImpl;.<init>(Lcom/facebook/jni/HybridData;)V"
        at com.facebook.react.bridge.CatalystInstanceImpl.getJSCallInvokerHolder(Native Method)
        at com.facebook.react.bridge.CatalystInstanceImpl.getJSCallInvokerHolder(CatalystInstanceImpl.java:1)
        at com.swmansion.reanimated.NativeProxy.<init>(NativeProxy.java:2)
        at d.q.b.c.u(NodesManager.java:1)
        at d.q.b.d.getJSIModules(ReanimatedJSIModulePackage.java:2)
        at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:22)
        at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:1)
        at com.facebook.react.ReactInstanceManager$e.run(ReactInstanceManager.java:12)
        at java.lang.Thread.run(Thread.java:919)

Does any of you has any idea how I could fix this problem ? Let me know if I can give you more information.

Note: I have no issues running the app in local / debug mode.

Screenshots

/

Steps To Reproduce

/

Expected behavior

The app should launch

Actual behavior

The app crash when launched

Snack or minimal code example

/

Package versions

  • React: 16.13.1
  • React Native: 0.63.3
  • React Native Reanimated: 2.0.0-alpha.7
馃彔 Reanimated2 馃悶 Bug

Most helpful comment

Thank you @drewandre your advice put me on the right path. I tried to add a rule in my proguard-rules.pro and it worked !!

Here is the rule I added :

-keep class com.facebook.react.turbomodule.** { *; }

Note: this rule is not documented in reanimated or hermes. I am not comfortable when it comes to proguard and stuff so if someone know more about it, it could be interesting to add this in the documentation on the right repo.

All 4 comments

After looking to the logs for a while I found to other lines that might be interesting :

2020-10-08 10:11:34.500 19145-19145/? E/SoLoader: couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: library "libjsc.so" not found result: 0
2020-10-08 10:11:34.694 19145-19221/? E/SoLoader: couldn't find DSO to load: libhermes-executor-debug.so caused by: dlopen failed: cannot locate symbol "_ZN8facebook6hermes13HermesRuntime11getDebuggerEv" referenced by "/data/app/[APP_ID]-mgcGgOTp-ODeHM10ZLbWaQ==/lib/arm64/libhermes-executor-debug.so"... result: 0

It seems that the issue would be related to hermes + reanimated

I had to disable proguard in release mode. Not sure if that was the real issue or if it was releated to reanimated at all but it fixed this issue for me. Make sure you follow the hemes docs closely.

Thank you @drewandre your advice put me on the right path. I tried to add a rule in my proguard-rules.pro and it worked !!

Here is the rule I added :

-keep class com.facebook.react.turbomodule.** { *; }

Note: this rule is not documented in reanimated or hermes. I am not comfortable when it comes to proguard and stuff so if someone know more about it, it could be interesting to add this in the documentation on the right repo.

We can add this to the docs, may be helpful to other people using proguard.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robertgonzales picture robertgonzales  路  3Comments

afctemka picture afctemka  路  3Comments

bdrobinson picture bdrobinson  路  3Comments

sa8ab picture sa8ab  路  3Comments

ArsalanCsquare picture ArsalanCsquare  路  3Comments