Skip to content

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

@buschco

Description

@buschco

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: AndroidAndroid applications.Resolution: Issue in another tool or repoAn issue that was opened against React Native but in reality is affecting another tool or libraryType: New ArchitectureIssues and PRs related to new architecture (Fabric/Turbo Modules)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions