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.

App build failure from monorepo [expo/node_modules/react-native-reanimated/android/../../react-native/package.json (No such file or directory)]

See original GitHub issue

Description

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

  1. git clone https://github.com/joseito-terence/build-error-repo.git
  2. yarn
  3. cd apps/expo
  4. 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:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
joseito-terencecommented, Oct 27, 2022

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-reanimated

1reaction
joseito-terencecommented, Oct 25, 2022

You 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

Read more comments on GitHub >

github_iconTop 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 >

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