Description
Description
When reanimated library is added to a expo managed workflow project this error occurs. I had a project where I used the library. The project worked fine in expo go build but in the final apk and in development build, the above error is thrown. I have followed exactly as per documentation, still the error is thrown.
Note: Previous issue opened for the same issue closed stating that the bug is fixed in RNv 76.5. However the bug occurs in this version too.
my package.json.
{
"name": "teach",
"version": "1.0.0",
"main": "index.ts",
"scripts": {
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"@react-navigation/native": "^7.0.14",
"@react-navigation/native-stack": "^7.2.0",
"babel-preset-expo": "~12.0.0",
"expo": "~52.0.20",
"expo-dev-client": "~5.0.6",
"expo-status-bar": "~2.0.0",
"react": "18.3.1",
"react-native": "0.76.5",
"react-native-gesture-handler": "~2.20.2",
"react-native-reanimated": "~3.16.1",
"react-native-safe-area-context": "4.12.0",
"react-native-screens": "~4.1.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@types/react": "~18.3.12",
"typescript": "^5.3.3",
"@react-native-community/cli": "latest"
},
"private": true
}
babel.config
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: ['react-native-reanimated/plugin'],
};
};
metro.cofig.js
// Learn more https://docs.expo.io/guides/customizing-metro
const { wrapWithReanimatedMetroConfig } = require('react-native-reanimated/metro-config');
const { getDefaultConfig } = require('expo/metro-config');
/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname);
module.exports = wrapWithReanimatedMetroConfig(config);
Steps to reproduce
- create a expo app using blank typescript template.
- install reanimated using npx expo install react-native-reanimated.
- update babel and metro config file. (Although expo documentation states that this step is not necessary. Only reanimated 4. documentation recommends this step)
- In the home page, define a example as per documentation.
- create a development build.
- The apk will not work.
Snack or a link to a repository
https://github.com/jeeva-2311/teacherBotTesting
Reanimated version
3.16.1
React Native version
76.5
Platforms
Android
JavaScript runtime
None
Workflow
Expo Dev Client
Architecture
None
Build type
Release app & dev bundle
Device
Real device
Device model
Google pixel 8
Acknowledgements
Yes