react-native: Fails to run react-native run-android (v0.68.0) without yarn

Description

when I create a test project and enable new architecture and Hermes it’s giving me this type error below:-

NOTE:- I KNOW I DON’T HAVE YARN (i love using npm that’s why I don’t install yarn in my system maybe this error is fixed after yarn install but it does not mean we can’t run our project through npm)

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 936 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Installing the app...

> Configure project :app
Unable to detect AGP versions for included builds. All projects in the build should use the same AGP version. Class name for the included build object: org.gradle.composite.internal.DefaultIncludedBuild$IncludedBuildImpl_Decorated.

> Task :ReactAndroid:generateCodegenSchemaFromJavaScript FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
9 actionable tasks: 1 executed, 8 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ReactAndroid:generateCodegenSchemaFromJavaScript'.
> A problem occurred starting process 'command 'yarn''

* 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

BUILD FAILED in 6s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ReactAndroid:generateCodegenSchemaFromJavaScript'.
> A problem occurred starting process 'command 'yarn''

* 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

BUILD FAILED in 6s

    at makeError (/Users/pushpendersingh/Desktop/Projects/RN/testV68/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:174:9)
    at /Users/pushpendersingh/Desktop/Projects/RN/testV68/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (/Users/pushpendersingh/Desktop/Projects/RN/testV68/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
    at async Command.handleAction (/usr/local/lib/node_modules/@react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.

Version

0.68.0

Output of npx react-native info

info Fetching system and libraries information… System: OS: macOS 12.3 CPU: (8) arm64 Apple M1 Memory: 89.94 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.14.0 - /usr/local/bin/node Yarn: Not Found npm: 8.3.1 - /usr/local/bin/npm Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: API Levels: 28, 30, 31, 32 Build Tools: 30.0.2, 32.0.0, 32.1.0, 33.0.0 System Images: android-32 | Google APIs ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8193401 Xcode: 13.3/13E113 - /usr/bin/xcodebuild Languages: Java: 12.0.2 - /Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home/bin//javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.68.0 => 0.68.0 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

  1. react-native init test
  2. cd test
  3. enable newArchEnabled=true (gradle.properties)
  4. enable enableHermes: true (build.gradle)
  5. react-native run-android (when the yarn is not installed on the system)

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

Github Repo:- https://github.com/pushpender-singh-ap/testV68

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 27 (3 by maintainers)

Commits related to this issue

Most upvoted comments

version 0.68.1 this issue has been resolved.

@Mmferry This issue fix in the latest react native versions

Is it worked with expo 45

Expo 45 is already deprecated use 48 and 47

I’m just upgrading incrementally from expo 43 and wanna make sure it build successfully

Than upgrade to 46 because deprecated versions not run in expo go application

I’m facing same problem have anyone solved?

Sorry for the late reply @pushpender-singh-ap, in the latest version 0.68.2 i am facing this issue https://github.com/facebook/react-native/issues/33944 it is in latest version Kindly look into it please Thanks

@ItsCDubb I think it would be the most transparent if you created a new issue with reproducible steps instead 🙏

@cortinico once this pr is merged please close this issue as well thanks for your response.