App build failure from monorepo [expo/node_modules/react-native-reanimated/android/../../react-native/package.json (No such file or directory)]
See original GitHub issueDescription
I’m unable to build the app. It throws an error. It works fine with Expo Go, no issues there.
I’ve tried playing around with the version of react-native-reanimated but no luck
Error looks like this:
[stderr] FAILURE: Build completed with 2 failures.
[stderr] 1: Task failed with an exception.
[stderr] -----------
[stderr] * Where:
[stderr] Build file '/home/expo/workingdir/build/apps/expo/node_modules/react-native-reanimated/android/build.gradle' line: 7
[stderr] * What went wrong:
[stderr] A problem occurred evaluating project ':react-native-reanimated'.
[stderr] > /home/expo/workingdir/build/apps/expo/node_modules/react-native-reanimated/android/../../react-native/package.json (No such file or directory)
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] 2: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] A problem occurred configuring project ':expo'.
[stderr] > compileSdkVersion is not specified. Please add it to build.gradle
[stderr] * Try:
[stderr] Run with -stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] * Get more help at https://help.gradle.org/
[stderr] BUILD FAILED in 44s
Steps to reproduce
- git clone https://github.com/joseito-terence/build-error-repo.git
- yarn
- cd apps/expo
- eas build -p android
Snack or a link to a repository
https://github.com/joseito-terence/build-error-repo
Reanimated version
2.3.1
React Native version
0.64.3
Platforms
Android
JavaScript runtime
No response
Workflow
Expo managed workflow
Architecture
Paper (Old Architecture)
Build type
No response
Device
Real device
Device model
No response
Acknowledgements
Yes
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
npx-create-react-native-library error on windows : enoent
When I try to create react native package using ... [Error: ENOENT: no such file or directory, open 'C:. ... example\package.json' }.
Read more >Working with monorepos - Expo Documentation
All yarn monorepos should have a "root" package.json file. ... Inside this apps/ folder, we can create a subfolder that contains the React...
Read more >Step by Step Guide on Creating a Monorepo for React Native ...
This blog post shows you how to create a React Native mobile app and a React web app in the same repo with...
Read more >Package.json (No such file or directory) - Jitsi Community Forum
An error occur when I run ./android/scripts/release-sdk.sh /tmp/repo: FAILURE: Build failed with an exception. Where: Build file ...
Read more >Building an application with React and Nx - LogRocket Blog
Create an application React and Nx, a build framework that allows you to build monorepos and scaffold full applications in place.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hey @tomekzaw, Thanks for the help.
I was able to fix the error. So, there seemed to have been multiple versions of react-native-reanimated in my project, which I figured out by inspecting yarn.lock and by running
yarn why react-native-reanimatedYou may check the monorepo here, https://github.com/joseito-terence/build-error-repo
repo |—apps | |----nextjs project | |----expo project |—packages | |----core
I checked the node_modules react-native-reanimated isn’t hoisted to the root node_modules of the workspace. it exists in /apps/expo/node_modules and react-native is in /node_modules