Skip to content

Could not load needed library 'libhermes.so' for 'libreanimated.so' #1676

Closed
@CyxouD

Description

@CyxouD

Describe the bug

I've expected crash could not load needed library 'libhermes.so' for 'libreanimated.so' after installing react-native-reanimated@2.2.4 with Android API 16:

E/AndroidRuntime: FATAL EXCEPTION: create_react_context
    java.lang.ExceptionInInitializerError
        at com.swmansion.reanimated.NodesManager.initWithContext(NodesManager.java:127)
        at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:18)
        at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1256)
        at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:131)
        at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1016)
        at java.lang.Thread.run(Thread.java:856)
     Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1891]:  1172 could not load needed library 'libhermes.so' for 'libreanimated.so' (load_library[1093]: Library 'libhermes.so' not found)
        at java.lang.Runtime.loadLibrary(Runtime.java:370)
        at java.lang.System.loadLibrary(System.java:535)
        at com.swmansion.reanimated.NativeProxy.<clinit>(NativeProxy.java:22)
        at com.swmansion.reanimated.NodesManager.initWithContext(NodesManager.java:127) 
        at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:18) 
        at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1256) 
        at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:131) 
        at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1016) 
        at java.lang.Thread.run(Thread.java:856) 

To Reproduce

Steps to reproduce the behaviour:

  1. Create react-native project with npx react-native init AwesomeProject --template react-native-template-typescript@6.5.13
  2. Add react-native-ui-lib
  3. Add react-native-gesture-handler
  4. Follow the guide to add react-native-reanimated@2.2.4
  5. Clean a build after enabling Hermes during the last step
  6. Build an app with Nexus S Android device API 16
  7. See a crash in your Android Studio console

Expected behaviour

An app runs and doesn't crash

Code snippet

Not needed

Screenshots

image

Device (please complete the following information)

  • Device: Nexus S
  • OS: Android API 16 (Google APIs)

Additional context

When I do the same steps with device Pixel 2 API 29 everything is OK, no crash. Also, API 16 device doesn't crash if just enable Hermes without adding react-native-ui-lib

Metadata

Metadata

Assignees

No one assigned

    Labels

    buga bug in one of the components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions