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

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

Closed
pushpender-singh-ap opened this issue Mar 30, 2022 · 27 comments
Closed

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

pushpender-singh-ap opened this issue Mar 30, 2022 · 27 comments
Labels
Platform: Android Android applications. Resolution: Locked This issue was locked by the bot. Resolution: PR Submitted A pull request with a fix has been provided. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@pushpender-singh-ap
Copy link

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

@react-native-bot react-native-bot added the Platform: Android Android applications. label Mar 30, 2022
@pushpender-singh-ap pushpender-singh-ap changed the title Fail to run react-native run-android Fails to run react-native run-android (v0.68.0) without yarn Mar 30, 2022
@cortinico
Copy link
Contributor

That's not expected. It's a bug in the setup of the New Architecture. Obviously installing yarn would fix it. @danilobuerger is working on a fix for this in #33530

@cortinico cortinico added Resolution: PR Submitted A pull request with a fix has been provided. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) and removed Needs: Triage 🔍 labels Mar 31, 2022
@pushpender-singh-ap
Copy link
Author

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

fortmarek pushed a commit that referenced this issue Apr 13, 2022
…#33530)

Summary:
It is not necessary to call node via yarn. Instead with this commit node is called directly (windows aware). This enables builds on systems that don't have yarn installed.

Fixes #33525

## Changelog

[Android] [Fixed] - Don't require yarn for codegen tasks

Pull Request resolved: #33530

Test Plan:
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)

(I have not tested or verified if this works on windows build machines)

Reviewed By: sshic

Differential Revision: D35279376

Pulled By: cortinico

fbshipit-source-id: 430e4a7bcdec7d5377efac747f6b935d634451cc
@ItsCDubb
Copy link

Except I use yarn already & I'm getting the same error, so it has nothing do do with yarn

@fortmarek
Copy link
Contributor

Hey @ItsCDubb, are you still seeing the same issue in the 0.68.1 release?

@ItsCDubb
Copy link

Hey @ItsCDubb, are you still seeing the same issue in the 0.68.1 release?

Yes I am & I don't know what it means in order to resolve it

@fortmarek
Copy link
Contributor

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

@ranadawar
Copy link

I'm using yarn and still facing the same error in v0.68.1. Any solution to solve the error? Because of this error unable to install the app neither in the emulator nor in android device

@ItsCDubb
Copy link

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

I believe I did it right at https://github.com/facebook/react-native/issues/33687

@pushpender-singh-ap
Copy link
Author

version 0.68.1 this issue has been resolved.

@FayyazAliKhan1
Copy link

@pushpender-singh-ap I am using 0.68.2 but it's still appearing, debug build not creating due to this

@pushpender-singh-ap
Copy link
Author

@FayyazAliKhan1 If you could send us screenshots with a sample repository, that would be helpful.

@FayyazAliKhan1
Copy link

FayyazAliKhan1 commented Jun 1, 2022

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

@palavellig
Copy link

gradlew clean --stacktrace

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.

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

"react": "17.0.2",
"react-native": "0.68.2",

any help??

@m7amad-7asan
Copy link

getting build failed with the same error when trying to clean or build the app
gradlew clean or gradlew assembleRelease

react: 17.0.2
react-native: 0.68.2

anyone got this error resolved ?

@m7amad-7asan
Copy link

@palavellig did you find any solution ?

@palavellig
Copy link

palavellig commented Oct 20, 2022

@m7amad-7asan

Open Android Studio Settings, then select Gradle JDK as version 11 from the dropdown.

sckAv

@palavellig
Copy link

palavellig commented Oct 20, 2022 via email

@Johnhollack
Copy link

adding this to your eas.json resolves the problem for me: @m7amad-7asan

"build": {
"production": {
"android": {
"buildType": "app-bundle",
"image": "latest"
}
}
}

@m7amad-7asan
Copy link

@Johnhollack

Thanks but I'm not using expo

Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this issue Jan 15, 2023
…facebook#33530)

Summary:
It is not necessary to call node via yarn. Instead with this commit node is called directly (windows aware). This enables builds on systems that don't have yarn installed.

Fixes facebook#33525

## Changelog

[Android] [Fixed] - Don't require yarn for codegen tasks

Pull Request resolved: facebook#33530

Test Plan:
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)

(I have not tested or verified if this works on windows build machines)

Reviewed By: sshic

Differential Revision: D35279376

Pulled By: cortinico

fbshipit-source-id: 430e4a7bcdec7d5377efac747f6b935d634451cc
@Mmferry
Copy link

Mmferry commented Mar 13, 2023

I'm facing same problem have anyone solved?

@pushpender-singh-ap
Copy link
Author

@Mmferry This issue fix in latest react native versions

@Mmferry
Copy link

Mmferry commented Mar 13, 2023

@Mmferry This issue fix in the latest react native versions

Is it worked with expo 45

@pushpender-singh-ap
Copy link
Author

@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

@Mmferry
Copy link

Mmferry commented Mar 13, 2023

@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

@pushpender-singh-ap
Copy link
Author

@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

@Malik-Usman17
Copy link

Still facing the same issue and i am not using expo, i am working react-native cli.
When i run my project on cmd by running this command npx react-native run-android or yarn react-native run-android,
it gave these errors.

@pushpender-singh-ap
Copy link
Author

@Malik-Usman17 can you tell us which react native version are you using

@facebook facebook locked as resolved and limited conversation to collaborators Apr 4, 2023
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Resolution: Locked This issue was locked by the bot. Resolution: PR Submitted A pull request with a fix has been provided. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

Successfully merging a pull request may close this issue.