RocketChat / Rocket.Chat.ReactNative

Rocket.Chat mobile clients
https://rocket.chat
MIT License
2.01k stars 1.17k forks source link

Error: Failed to install app during 'yarn android' command #5104

Open abhishekjmd opened 1 year ago

abhishekjmd commented 1 year ago

I encountered an error while attempting to build and install the app using the 'yarn android' command. The error message and relevant details are as follows:

-----------------------------------***------------------------------------------------------

Error: Command failed: gradlew.bat app:installExperimentalPlayDebug -PreactNativeDevServerPort=8081 CMake Deprecation Warning at CMakeLists.txt:42 (cmake_policy): The OLD behavior for policy CMP0026 will be removed from a future version of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all policies are deprecated and that a policy should be set to OLD only under specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD.

CMake Error at CMakeLists.txt:64 (project): Running

'nmake' '-?'

failed with:

The system cannot find the file specified

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage

FAILURE: Build failed with an exception.

BUILD FAILED in 29m 47s

at makeError (C:\Users\Hp\Desktop\Open Source Projects\Rocket.Chat.ReactNative\node_modules\execa\index.js:174:9)
at C:\Users\Hp\Desktop\Open Source Projects\Rocket.Chat.ReactNative\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (C:\Users\Hp\Desktop\Open Source Projects\Rocket.Chat.ReactNative\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7s:82:7)
at async Command.handleAction (C:\Users\Hp\Desktop\Open Source Projects\Rocket.Chat.ReactNative\ntive\node_modules\@react-native-community\cli\build\index.js:108:9)

info Run CLI with --verbose flag for more details.

-----------------------------------***------------------------------------------------------

I have ensured that I have the Android development environment set up following the instructions provided in the React Native documentation. However, the build process encountered the following issues:

Deprecation warning related to policy CMP0026 in CMakeLists.txt. CMake errors related to 'nmake' and missing compiler settings (CMAKE_C_COMPILER and CMAKE_CXX_COMPILER). Failure during the task ':react-native:ReactAndroid:hermes-engine:configureBuildForHermes' with a non-zero exit value. I have tried running the command with additional options such as '--stacktrace', '--info', and '--debug', but the error persists.

I would appreciate any assistance in resolving this build error and successfully installing the app. Thank you for your help.

Operating system: 64-bit operating system, x64-based processor Node.js version: v18.16.0 Yarn version: 1.22.19 React Native version: 0.71.7

abhishekjmd commented 1 year ago

I cloned the project did yarn install and then yarn android and got this error

hpanahiird commented 1 year ago

exactly the same problem here. did you find a solution?

abhishekjmd commented 1 year ago

didnt found any solution

ZakariaBenhirt89 commented 1 year ago

me too and collegue also shound use a defferent builf env like linux unix ...

yogesh6260 commented 1 year ago

The same error coming on my windows while running the Rocket.Chat.ReactNative android. Maybe It seems like currently, the project is not supported in Windows, that's the issue for Windows users, I think Rocket.Chat.ReactNative Team has to look out for and solve this issue so that anyone can test the app on Windows as well.

SanjaySargam commented 10 months ago

I am also facing the same issue