question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android || E/ReactNativeJS: Error: Failed to initialize react-native-reanimated library

See original GitHub issue

Description

This is the error I obtained when I tried to upgrade react native from 0.64.2 to 0.68.2 and reanimated from 1.13.2 to 2.2.4:

2022-10-13 00:31:00.532 25215-25313/com.restlessnetwork E/ReactNativeJS: Error: Failed to initialize react-native-reanimated library, make sure you followed installation steps here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/ 
    1) Make sure reanimated's babel plugin is installed in your babel.config.js (you should have 'react-native-reanimated/plugin' listed there - also see the above link for details) 
    2) Make sure you reset build cache after updating the config, run: yarn start --reset-cache, js engine: hermes
2022-10-13 00:31:00.544 25215-25313/com.restlessnetwork E/ReactNativeJS: Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
            A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes
    
    --------- beginning of crash
2022-10-13 00:31:00.562 25215-25314/com.restlessnetwork E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
    Process: com.restlessnetwork, PID: 25215
    com.facebook.react.common.JavascriptException: Error: Failed to initialize react-native-reanimated library, make sure you followed installation steps here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/ 
    1) Make sure reanimated's babel plugin is installed in your babel.config.js (you should have 'react-native-reanimated/plugin' listed there - also see the above link for details) 
    2) Make sure you reset build cache after updating the config, run: yarn start --reset-cache, js engine: hermes, stack:
    s@1806:1564
    c@1806:2163
    v@1806:2321
    _@1806:2483
    k@1806:2457
    anonymous@1805:85
    h@2:1707
    d@2:1150
    i@2:496
    anonymous@1769:8094
    h@2:1707
    d@2:1150
    i@2:496
    anonymous@1768:988
    h@2:1707
    d@2:1150
    i@2:496
    anonymous@1767:571
    h@2:1707
    d@2:1150
    i@2:496
    anonymous@1741:386
    h@2:1707
    d@2:1150
    i@2:496
    anonymous@1739:602
    h@2:1707
    d@2:1150
    i@2:496
    anonymous@1738:1230
    h@2:1707
    d@2:1150
    i@2:496
    anonymous@1737:126
    h@2:1707
    d@2:1150
    i@2:496
    anonymous@383:641
    h@2:1707
    d@2:1150
    i@2:496
    anonymous@382:167
    h@2:1707
    d@2:1150
    i@2:496
    anonymous@6:57
    h@2:1707
    d@2:1080
    i@2:496
    global@3376:3
    
        at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:72)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
        at java.lang.Thread.run(Thread.java:920)

Steps to reproduce

  1. Add the new lines in MainApplication.java
  2. Execute npx react-native run-android
  3. The app is installed in emulator
  4. The app closed itself.

This is my package.json:

“dependencies”: { “@eva-design/eva”: “^2.0.0”, “@flyerhq/react-native-link-preview”: “^1.6.0”, “@ptomasroos/react-native-multi-slider”: “^2.2.2”, “@react-native-async-storage/async-storage”: “^1.13.4”, “@react-native-community/cli”: “7.0.2”, “@react-native-community/datetimepicker”: “^3.4.3”, “@react-native-community/masked-view”: “^0.1.10”, “@react-native-community/netinfo”: “^6.2.1”, “@react-native-community/push-notification-ios”: “^1.10.1”, “@react-native-firebase/app”: “^11.1.0”, “@react-native-firebase/auth”: “^11.1.0”, “@react-native-firebase/firestore”: “^11.1.0”, “@react-native-firebase/messaging”: “^11.1.0”, “@react-native-picker/picker”: “^1.16.3”, “@react-native-seoul/masonry-list”: “^1.1.4”, “@react-navigation/bottom-tabs”: “^5.11.2”, “@react-navigation/drawer”: “6.1.0”, “@react-navigation/material-top-tabs”: “^5.3.10”, “@react-navigation/native”: “6.0.2”, “@react-navigation/stack”: “^5.12.8”, “@ui-kitten/components”: “^5.0.0”, “add”: “^2.0.6”, “apollo3-cache-persist”: “^0.9.1”, “axios”: “^0.21.1”, “expo-linear-gradient”: “^11.0.2”, “global”: “^4.4.0”, “graphql”: “^15.5.0”, “i18next”: “^19.8.7”, “jwt-decode”: “^3.1.2”, “lodash”: “^4.17.21”, “lottie-ios”: “3.2.3”, “lottie-react-native”: “^4.0.2”, “markdown-it”: “^12.0.6”, “mixpanel”: “^0.14.0”, “mixpanel-react-native”: “^1.3.7”, “moment”: “^2.29.1”, “native-base”: “^2.15.2”, “react”: “17.0.2”, “react-hook-form”: “^6.15.4”, “react-i18next”: “^11.8.6”, “react-native”: “0.68.2”, “react-native-3dcube-navigation”: “^1.0.4”, “react-native-adapty”: “^1.3.13”, “react-native-animated-component”: “^0.1.0”, “react-native-background-timer”: “^2.4.1”, “react-native-calendars”: “^1.1284.0”, “react-native-camera”: “4.2.0”, “react-native-country-picker-modal”: “^2.0.0”, “react-native-create-thumbnail”: “^1.4.1”, “react-native-debugger”: “^1.1.0”, “react-native-device-info”: “^8.1.3”, “react-native-elements”: “^3.3.1”, “react-native-error-boundary”: “^1.1.9”, “react-native-fbsdk-next”: “^10.1.0”, “react-native-fit-image”: “^1.5.5”, “react-native-fs”: “^2.16.6”, “react-native-geolocation-service”: “^5.3.0-beta.1”, “react-native-gesture-handler”: “1.10.3”, “react-native-gifted-chat”: “^0.16.3”, “react-native-htmlview”: “^0.16.0”, “react-native-image-picker”: “^4.1.1”, “react-native-image-resizer”: “^1.4.5”, “react-native-in-app-review”: “^3.2.3”, “react-native-keyboard-manager”: “^6.5.4-1”, “react-native-linear-gradient”: “^2.5.6”, “react-native-localize”: “^2.1.7”, “react-native-marquee”: “^0.4.0”, “react-native-modalbox”: “^2.0.2”, “react-native-network-info”: “^5.2.1”, “react-native-pell-rich-editor”: “^1.8.8”, “react-native-percentage-circle”: “^1.0.7”, “react-native-phone-number-input”: “^2.1.0”, “react-native-ping”: “^1.2.6”, “react-native-push-notification”: “^8.1.1”, “react-native-ratings”: “^8.1.0”, “react-native-reanimated”: “2.2.4”, “react-native-safe-area-context”: “^3.1.9”, “react-native-screens”: “3.5.0”, “react-native-share”: “^5.1.6”, “react-native-skeleton-placeholder”: “^4.0.0”, “react-native-svg”: “^12.1.0”, “react-native-swipe-gestures”: “^1.0.5”, “react-native-tab-view”: “^2.15.2”, “react-native-thumbnail-video”: “^0.1.2”, “react-native-toast-message”: “^1.4.7”, “react-native-vector-icons”: “^7.1.0”, “react-native-video”: “^5.1.1”, “react-native-webview”: “^11.17.1”, “react-native-wheel-color-picker”: “^1.2.0”, “react-navigation”: “^4.4.3”, “react-redux”: “^7.2.2”, “redux”: “^4.1.0”, “redux-persist”: “^6.0.0”, “redux-thunk”: “^2.3.0”, “reselect”: “^4.0.0”, “sendbird”: “^3.0.143” },

This is my babel.config.js

module.exports = { presets: [‘module:metro-react-native-babel-preset’], plugins: [‘react-native-reanimated/plugin’], };

Snack or a link to a repository

Reanimated version

2.2.4

React Native version

0.68.2

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

Android emulator

Device model

Pixel 4 API

Acknowledgements

Yes

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:22 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
lauraleonillacommented, Oct 27, 2022

Yeah I restarted my computer and it worked. But I’m not sure if what actually fixed it. 🥲

6reactions
lauraleonillacommented, Oct 19, 2022

Did you do something that solved it? I can’t get past this issue. @ardhendu12345

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Failed to initialize react-native-reanimated library
Mine is working the only diff is: babel.config.js module.exports = function(api) { api.cache(true); return { presets: ['babel-preset-expo'], ...
Read more >
Failed to initialize react-native-reanimated library... FIX
REACT-NATIVE FIX forFailed to initialize react-native-reanimated library orMake sure reanimated bable config is installed...
Read more >
ERROR Error: Failed to initialize react-native-reanimated library
Please do like share and comment if you like the video please do hit like and if you have any query please write...
Read more >
failed to initialize react-native-reanimated library - You.com
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle...
Read more >
Troubleshooting common problems | React Native Reanimated
This error frequently happens when metro cache is not updated. Clear it with: watchman watch-del-all yarn start --reset-cache.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found