facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.88k stars 24.3k forks source link

Getting Error in createBundleOnboardingappProdReleaseJsAndAssets while using the docker :- Error OS not recognized. Please set project.react.hermesCommand to the path of a working Hermes compiler. #47173

Closed khushahal closed 2 days ago

khushahal commented 2 days ago

Description

I am creating a docker image for react native android. I am trying to build the andorid apk using cmd in docker shell but getting the below error. Using the below file as a docker :- https://github.com/react-native-community/docker-android/blob/main/Dockerfile

Task :app:createBundleOnboardingappProdReleaseJsAndAssets 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.5/userguide/command_line_interface.html#sec:command_line_warnings 446 actionable tasks: 3 executed, 443 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

FAILURE: Build failed with an exception.

BUILD FAILED in 1m 9s

Steps to reproduce

Just build command for app

React Native Version

0.72.7

Affected Platforms

Runtime - Android

Output of npx react-native info

info Fetching system and libraries information...
System:
  OS: Linux 6.6 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
  CPU: (8) arm64 unknown
  Memory: 7.38 GB / 9.70 GB
  Shell:
    version: 5.1.16
    path: /bin/bash
Binaries:
  Node:
    version: 18.20.4
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/local/bin/yarn
  npm:
    version: 10.7.0
    path: /usr/local/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 30.0.3
      - 35.0.0
    Android NDK: 27.1.12297006
IDEs:
  Android Studio: Not Found
Languages:
  Java:
    version: 17.0.12
    path: /usr/bin/javac
  Ruby:
    version: 3.0.2
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.7
    wanted: 0.72.7
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

> Task :app:createBundleOnboardingappProdReleaseJsAndAssets 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.5/userguide/command_line_interface.html#sec:command_line_warnings
446 actionable tasks: 3 executed, 443 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor 

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:createBundleOnboardingappProdReleaseJsAndAssets'.
> OS not recognized. Please set project.react.hermesCommand to the path of a working Hermes compiler.

* 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 1m 9s
error Failed to install the app.
error Command failed with exit code 1.

Reproducer

none

Screenshots and Videos

image
react-native-bot commented 2 days ago
:warning: Unsupported Version of React Native
:information_source: It looks like your issue or the example you provided uses an unsupported version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.
react-native-bot commented 2 days ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
react-native-bot commented 2 days ago
:warning: Unsupported Version of React Native
:information_source: It looks like your issue or the example you provided uses an unsupported version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.
react-native-bot commented 2 days ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
khushahal commented 2 days ago

@cortinico I have tried all the possible ways to bypass the error but nothing is working here.

cortinico commented 2 days ago

Duplicate of https://github.com/facebook/react-native/issues/47112