react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

Failure to boot after upgrade to 2.10.0 with dlopen failed: library "libreanimated.so" not found.

Open whithajess opened this issue 1 year ago • 4 comments

Description

After upgrading from 2.9.1 to 2.10.0 clearing absolutely all caches and rebuilding our app fails to start with the following error:

ERROR  Error: Exception in HostFunction: java.lang.UnsatisfiedLinkError: dlopen failed: library "libreanimated.so" not found
LOG  Running "MobileApp" with {"rootTag":1}
ERROR  Invariant Violation: "MobileApp" has not been registered. This can happen if:
  * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  * A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
error: Error: Unable to resolve module react-native-reanimated from /mobile_app/node_modules/@react-navigation/drawer/src/views/DrawerView.tsx: react-native-reanimated could not be found within the project or in these directories:

After downgrading the app continues to boot and work as normal.

Potentially useful information from App:

  • compileSdkVersion = 31
  • targetSdkVersion = 31
  • Gradle version 7.2
  • Gradle Plugin: com.android.tools.build:gradle:7.0.1
  • enableHermes: false
  • Node v16.15.0

Steps to reproduce

  1. Upgrade from 2.9.1 to 2.10.0
  2. Clear all caches
  3. Attempt to run-android
  4. See failure on app boot.
  5. Downgrade back to 2.9.1 to confirm still working.

Snack or a link to a repository

hard to produce a full app mvce

Reanimated version

2.10.0

React Native version

0.68.3

Platforms

Android

JavaScript runtime

No response

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Release mode

Device

Android emulator

Device model

Pixel 2 - Android 11.0 Google Play | x86_64

Acknowledgements

Yes

whithajess avatar Aug 31 '22 23:08 whithajess

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

github-actions[bot] avatar Aug 31 '22 23:08 github-actions[bot]

Hey @whithajess, thanks for submitting the issue.

One of the reasons why this error might occur is that the app is build for different Android ABI than the emulator you are currently using.

Can you please confirm that the app has been indeed built for x86_64?

You can rename the *.apk file to *.zip, unpack it and check if lib/x86_64/libreanimated.so exists.

tomekzaw avatar Sep 15 '22 08:09 tomekzaw

I have the same issue in Android device in debug mode.

SMhdAsadi avatar Sep 22 '22 13:09 SMhdAsadi

I had to add this to my build.gradle file (note the addition of the lib/**/libreanimated.so)

packagingOptions { jniLibs { pickFirsts += ['**/libc++_shared.so', 'lib/**/libreanimated.so'] } }

thedavidhuang avatar Sep 28 '22 00:09 thedavidhuang