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

[Reanimated] Couldn't determine the version of the native part of Reanimated.

Open brandon2580 opened this issue 3 years ago • 16 comments

Description

I am trying to upgrade my react-native version and in the process of doing so, I have ran into an issue with react-native-reanimated. Whenever my app builds, I get the following error in my metro console - [Reanimated] Couldn't determine the version of the native part of Reanimated. Did you forget to re-build the app after upgrading react-native-reanimated? If you use Expo Go, you must use the exact version which is bundled into Expo SDK

I have tried:

  • expo doctor --fix-dependencies
  • Deleting podfile.lock, DerivedData folder, build folder, Pods folder, project_name.xcworkspace folder, node_modules, yarn.lock and reinstalling packages using yarn install
  • npx expo install react-native-reanimated
  • yarn cache clean
  • expo start --clear

Here is my metro.config -


module.exports = (async () => {
  const {
    resolver: { sourceExts, assetExts }
  } = await getDefaultConfig();
  return {
    transformer: {
      getTransformOptions: async () => ({
        transform: {
          experimentalImportSupport: false,
          inlineRequires: false
        }
      }),
      babelTransformerPath: require.resolve("react-native-svg-transformer")
    },
    resolver: {
      assetExts: assetExts.filter(ext => ext !== "svg"),
      sourceExts: [...sourceExts, "svg", "cjs"]
    }
  };
})();

Here is my babel.config.js -

const config = {
  presets: ['module:metro-react-native-babel-preset','babel-preset-expo'],
  env: {
    production: {
      plugins: ['transform-remove-console'],
    },
    test: {
      plugins: [
        [
          'module:react-native-dotenv',
          {
            moduleName: '@env',
          },
        ],
      ],
    },
  },
  plugins: [
    [
      'module:react-native-dotenv',
      {
        moduleName: '@env',
        safe: true,
        allowUndefined: true,
      },
    ],
    [
      '@babel/plugin-proposal-decorators',
      {
        legacy: true,
      },
    ],
    '@babel/plugin-proposal-optional-catch-binding',
    '@babel/plugin-proposal-export-namespace-from',
    '@babel/plugin-proposal-numeric-separator',
    [
      'module-resolver',
      {
        root: ['./'],
        extensions: [
          '.ios.js',
          '.android.js',
          '.js',
          '.jsx',
          '.ts',
          '.tsx',
          '.json',
        ],
        alias: {
          '^@app/(.+)': './app/\\1',
          '^@story/(.+)': './.storybook/\\1',
        },
        cwd: 'packagejson',
      },
    ],
    'react-native-reanimated/plugin',
  ],
};

module.exports = (api) => {
  api.cache(true);
  return config;
};

Any pointers in the right direction would be hugely helpful. I spent a whole day trying to resolve this with no luck unfortunately.

Steps to reproduce

  1. yarn install
  2. Build app from XCode (14.2)
  3. Once simulator loads & metro builds the app, I get the error

Snack or a link to a repository

https://snack.expo.io/

Reanimated version

2.14.4

React Native version

0.71.4

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Expo bare workflow

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

2020 M1 Macbook Pro

Acknowledgements

Yes

brandon2580 avatar Mar 22 '23 05:03 brandon2580

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 Mar 22 '23 05:03 github-actions[bot]

Hey @Wolf-111, Reanimated 2.14.4 doesn't support Fabric (New Architecture). Please upgrade to Reanimated 3.0.2.

tomekzaw avatar Mar 22 '23 08:03 tomekzaw

Hi @tomekzaw - Expo 48 requires Reanimated 2.14.4 specifically. Is there another approach I can take? Should I move to a different architecture?

brandon2580 avatar Mar 22 '23 14:03 brandon2580

@Wolf-111, I'm afraid you cannot use Fabric with Expo managed workflow (SDK 48). So you can either use Expo bare workflow and use Reanimated 3 with Fabric enabled (the new renderer) or stick with Expo managed workflow and use Reanimated 2 on Paper (the old renderer).

See https://medium.com/the-exponent-log/expo-sdk-48-ccb8302e231:

screenshot

tomekzaw avatar Mar 22 '23 14:03 tomekzaw

@tomekzaw Unfortunately even when I try to use Expo bare workflow (using expo prebuild), I still encounter the same error regardless of my react-native-reanimated version

brandon2580 avatar Mar 22 '23 22:03 brandon2580

@Wolf-111 99.9% it will break things entirely but have you tried using package.json resolutions object eg:

  "resolutions": {
    "react-native-reanimated": "3.0.2",
  }

efstathiosntonas avatar Mar 28 '23 06:03 efstathiosntonas

Make sure you clear cache too. expo start -c

ansh avatar Apr 30 '23 02:04 ansh

first step try this version its just worked for me on upgrading to 0.71.3

omarhamedx avatar Nov 14 '23 12:11 omarhamedx

Uploading 7ddcf101-2471-4672-9ef4-d316d472ca56.JPG…

Hello i currenlty i am using react native version [email protected] and i have the reanimated version 3.5.4 it is working in android simulator but when i am trying to run on my android devices then it's giving this error i had tried many version of reanimated lib but none of them working getting same issues pls someone help me to resolve this issues 7ddcf101-2471-4672-9ef4-d316d472ca56

Aakash359 avatar Dec 13 '23 17:12 Aakash359

i am using react native version [email protected] and i have the reanimated version 3.5.4

Reanimated 3.5.4 does not support React Native 0.73.0, you need to upgrade Reanimated to 3.6.1.

Also, are you using JS bundle in dev mode with release build of the app?

tomekzaw avatar Dec 13 '23 17:12 tomekzaw

i am using react native version [email protected] and i have the reanimated version 3.5.4

Reanimated 3.5.4 does not support React Native 0.73.0, you need to upgrade Reanimated to 3.6.1.

Also, are you using JS bundle in dev mode with release build of the app?

ok let me try and check nope it's not working currently working on dev mode not in release

Aakash359 avatar Dec 13 '23 17:12 Aakash359

Hey,

anyone found solution to this, I've tried everything Expo SDK 50 RN 0.73.2 reanimated 3.6.0 have tried 3.6.1 as well

sahiljaidka224 avatar Jan 25 '24 00:01 sahiljaidka224

Same here as @sahiljaidka224. I started getting that warning after upgrading from 49 to 50.0.3. I already have reanimated 3.6.1

abpbackup avatar Jan 25 '24 15:01 abpbackup

We also received this warning after upgrading Expo to 50. Updated react-native-reanimated from 3.6.0 to 3.6.2 and the warning disappeared.

Jerere avatar Jan 26 '24 07:01 Jerere

We also received this warning after upgrading Expo to 50. Updated react-native-reanimated from 3.6.0 to 3.6.2 and the warning disappeared.

I confirm, did the same and warning disappeared, thanks a lot upgrade to 3.6.2 guys :)

codewithsabri avatar Jan 26 '24 08:01 codewithsabri

This is working for M1 IOS React reanimated 3.6.2

pollyolly avatar Feb 12 '24 06:02 pollyolly