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] 2.3.1 and RNGH: can't build my Android app anymore (Expo SDK 44, Custom Dev Client)

See original GitHub issue

Description

After upgrading, I can’t build my Android app anymore. I had no problems with SDK 43 / RNGH 1.3. As soon as RNGH is installed together with Reanimated, it ends up with an error

Screenshots

> Configure project :expo

Using expo modules
  - expo-application (4.0.1)
  - expo-constants (13.0.0)
  - expo-device (4.1.0)
  - expo-file-system (13.1.0)
  - expo-font (10.0.4)
  - expo-haptics (11.1.0)
  - expo-intent-launcher (10.1.0)
  - expo-json-utils (0.2.0)
  - expo-keep-awake (10.0.1)
  - expo-manifests (0.2.2)
  - expo-modules-core (0.6.3)
  - expo-notifications (0.14.0)
  - expo-splash-screen (0.14.0)
  - expo-system-ui (1.1.0)
  - react-native-reanimated (2.3.1)


FAILURE: Build failed with an exception.

* Where:
Build file '*****/myapp/node_modules/react-native-gesture-handler/android/build.gradle' line: 26

* What went wrong:
A problem occurred evaluating project ':react-native-gesture-handler'.
> ****/myapp/packages/expo/android/../node_modules/react-native-reanimated/package.json (No such file or directory)

* Try:
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.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 10s
/myapp/packages/expo/android/gradlew exited with non-zero code: 1
Error: /myapp/packages/expo/android/gradlew exited with non-zero code: 1
    at ChildProcess.completionListener (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
    at Object.onceWrapper (events.js:520:26)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1058:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
    ...
    at spawnAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
    at spawnGradleAsync (/usr/local/lib/node_modules/expo-cli/src/commands/run/android/spawnGradleAsync.ts:83:18)
    at assembleAsync (/usr/local/lib/node_modules/expo-cli/src/commands/run/android/spawnGradleAsync.ts:57:16)
    at actionAsync (/usr/local/lib/node_modules/expo-cli/src/commands/run/android/runAndroid.ts:143:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The terminal process "zsh '-c', 'yarn run run:android'" terminated with exit code: 1.

Steps To Reproduce

  1. Install RNGH with RNREA
  2. Try to build with “expo run:android” (same applies to react-native run-android and yarn run android)

Expected behavior

Should build my Android App

Actual behavior

Build not possible

Hints

When I remove RNGH or RNREA, the build succeeds. So installing RNGH without REA or vice versa is possible, but not both together.

Package versions

  • React Native: 0.64.3
  • React Native Gesture Handler: 2.1.0

Affected platforms

  • Android
  • iOS
  • Web
  Expo CLI 5.0.1 environment info:
    System:
      OS: macOS 11.6.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 14.18.2 - /usr/local/opt/node@14/bin/node
      Yarn: 1.22.17 - /usr/local/bin/yarn
      npm: 6.14.15 - /usr/local/opt/node@14/bin/npm
    Managers:
      CocoaPods: 1.11.2 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
    IDEs:
      Android Studio: 4.1 AI-201.8743.12.41.6953283
      Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
    npmGlobalPackages:
      eas-cli: 0.33.0
      expo-cli: 5.0.1
    Expo Workflow: bare

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

4reactions
simontoulouzecommented, Jul 13, 2022

Hi, I’m getting the same error but directly related to react-native-reanimated.

A problem occurred evaluating project ':react-native-reanimated'.
> /home/expo/workingdir/build/app/native/node_modules/react-native/package.json (No such file or directory)

We have a monorepo and the react-native package is not located in app/native/node_modules but in app/node_modules.

Do you know any way to fix that ? I tried to patch the build.gradle function which resolves the react-native one, but it doesn’t seems to be considered during eas build

def resolveReactNativeDirectory() {
    if (isDeveloperMode()) {
        return file("$projectDir/../../node_modules/react-native")
    }
    return file("$projectDir/../../../../node_modules/react-native")
}

EDIT : fixed by downgrading react-native-reanimated from 2.8.0 to 2.6.0

1reaction
felippepuhlecommented, Aug 2, 2022

@piaskowyk how bad would be replacing return file("$projectDir/../../react-native") by return file(findNodeModulePath(projectDir, "react-native"))?

I fixed the problem applying the above as a patch on my repo, happy to put a PR if it makes sense:

diff --git a/node_modules/react-native-reanimated/android/build.gradle b/node_modules/react-native-reanimated/android/build.gradle
index cc460da..fc2e7a6 100644
--- a/node_modules/react-native-reanimated/android/build.gradle
+++ b/node_modules/react-native-reanimated/android/build.gradle
@@ -83,7 +83,7 @@ def resolveReactNativeDirectory() {
     if (isDeveloperMode()) {
         return file("$projectDir/../node_modules/react-native")
     }
-    return file("$projectDir/../../react-native")
+    return file(findNodeModulePath(projectDir, "react-native"))
 }
 
 abstract class replaceSoTask extends DefaultTask {

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo SDK 45. Today we're announcing the release of…
Bumped Android compileSdkVersion to 31 and Java 11. ... Upgrade expo-dev-client to 0.9.3 and make a new development build to test the latest...
Read more >
gradlew exited with non-zero code: 1 - You.com
I'm trying to run my React-Native (Expo) app on Android device. ... 2.3.1 and RNGH: can't build my Android app anymore (Expo SDK...
Read more >
Bug listing with status UNCONFIRMED as at 2022/12/24 17 ...
Bug:128538 - "sys-apps/coreutils: /bin/hostname should be installed from ... Bug:366739 - "dev-util/android-sdk-update-manager should install desktop ...
Read more >
Problem after update expo sdk 44 -> 47: Java.lang.double ...
And when updating from version 44 to 47, I got the following error when run the app (expo start): Java.lang.double cannot be cast...
Read more >
Installation | React Native Gesture Handler - Software Mansion
20 . If you need to use a different Kotlin version, set the kotlinVersion ext property in android/build.gradle file and RNGH will ...
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