Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android build fails at generateCodegenArtifactsFromSchema step: ENOENT: no such file or directory, lstat 'android' #36286

Closed
buschco opened this issue Feb 24, 2023 · 5 comments
Labels
Platform: Android Android applications. Resolution: Issue in another tool or repo An issue that was opened against React Native but in reality is affecting another tool or library Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@buschco
Copy link

buschco commented Feb 24, 2023

Description

Running yarn react-native run-android fails with this error. Removing react-native-gesture-handler results in the next dependency to fail.

> Task :react-native-gesture-handler:generateCodegenSchemaFromJavaScript FAILED
node:internal/fs/utils:347
    throw err;
    ^

Error: ENOENT: no such file or directory, lstat 'android'
    at Object.lstatSync (node:fs:1574:3)
    at /Users/colin/Documents/project/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js:75:10

running ./gradlew generateCodegenArtifactsFromSchema in android folder also fails with the same message.

React Native Version

0.71.3

Output of npx react-native info

System:
    OS: macOS 13.2.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 1.42 GB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.6.0 - /var/folders/sj/lr7ybqnx3vs0rn7xc9g_34h00000gn/T/yarn--1677247283616-0.8451485942008805/node
    Yarn: 1.22.19 - /var/folders/sj/lr7ybqnx3vs0rn7xc9g_34h00000gn/T/yarn--1677247283616-0.8451485942008805/yarn
    npm: 8.16.0 - ~/.nvm/versions/node/v18.6.0/bin/npm
    Watchman: 2023.01.16.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: Not Found
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9123335
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.16 - /Users/colin/.sdkman/candidates/java/current/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0
    react-native: ^0.71.3 => 0.71.3
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

I am not sure, maybe I am missing something but the steps should be creating a an app w/ react native 0.70 add react-native-gesture-handler (or any other native dependency) and upgrade to 0.71.

Snack, code example, screenshot, or link to a repository

in my app/build.gradle the react { } block is empty.

@buschco buschco added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Feb 24, 2023
@react-native-bot react-native-bot added the Platform: Android Android applications. label Feb 24, 2023
@cortinico
Copy link
Contributor

Running yarn react-native run-android fails with this error. Removing react-native-gesture-handler results in the next dependency to fail.

Can you report this to react-native-gesture-handler here?
https://github.com/software-mansion/react-native-gesture-handler/issues.

I'll close this for now as I believe it's a bug in their integration, but please reopen this one if they get back with a bug inside React Native core.

@cortinico cortinico added Resolution: Issue in another tool or repo An issue that was opened against React Native but in reality is affecting another tool or library and removed Needs: Triage 🔍 labels Feb 24, 2023
@buschco
Copy link
Author

buschco commented Feb 24, 2023

@cortinico Thanks for the reply!
If I remove react-native-gesture-handler the issue occurs for react-native-screens. I think react-native-gesture-handler is not the problem here but I will open an issue there 👍

@cortinico
Copy link
Contributor

If I remove react-native-gesture-handler the issue occurs for react-native-screens. I think react-native-gesture-handler is not the problem here but I will open an issue there 👍

Can you then create a sample repo with the new app template + a single library where this issue reproduces?

@j-piasecki
Copy link
Collaborator

@buschco I wasn't able to reproduce it on my own, the repository with a reproduction would be greatly appreciated.

@buschco
Copy link
Author

buschco commented Feb 27, 2023

Thanks for your effort @j-piasecki ! I was able to fix my issue. I had react-native-codegen as a dependency in my package.json and probably the version was not the right one. After removing it, it worked 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android Android applications. Resolution: Issue in another tool or repo An issue that was opened against React Native but in reality is affecting another tool or library Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

4 participants