react-native
react-native copied to clipboard
building android build for the react native tester app is failing
Description
for couple of days, i am unable to build the react native tester app, for the android, though the iOS is building successfully without any issues, the android build is failing and i am kinda unable to figure out, though my local environment is set up correctly as i am able to run a react native scaffolding without any issue and build the android counterpart.
here are error logs while trying to build the rn tester app
Steps to reproduce
- cd
react-native
, the main react native repository - try
yarn android
- build probably would fail
React Native Version
0.75.0-main
Affected Platforms
Runtime - Android
Output of npx react-native info
System:
OS: macOS 14.4
CPU: (10) arm64 Apple M2 Pro
Memory: 79.33 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.0.0
path: /opt/homebrew/bin/node
Yarn:
version: 3.6.4
path: /opt/homebrew/bin/yarn
npm:
version: 10.5.1
path: /opt/homebrew/bin/npm
Watchman:
version: 2024.04.22.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.4
- iOS 17.4
- macOS 14.4
- tvOS 17.4
- visionOS 1.1
- watchOS 10.4
Android SDK:
API Levels:
- "34"
Build Tools:
- 34.0.0
System Images:
- android-34 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2023.2 AI-232.10300.40.2321.11668458
Xcode:
version: 15.3/15E204a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.11
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.3.1
wanted: 18.3.1
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Stacktrace or Logs
BUILD FAILED in 8s
error Failed to install the app. Command failed with exit code 1: ./gradlew installHermesDebug -PreactNativeDevServerPort=8081
mv: rename /var/folders/m4/63wc07xj00l5mnzjhc9xrfpr0000gn/T/tmp.unSvgiTHau/lib to /Users/bikidas/react-native/packages/react-native-codegen/scripts/oss/../../lib: No such file or directory
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. FAILURE: Build failed with an exception. * What went wrong:
Execution failed for task ':packages:react-native:ReactAndroid:buildCodegenCLI'.
> Process 'command '/Users/bikidas/react-native/packages/react-native-codegen/scripts/oss/build.sh'' finished with non-zero exit value 1 * Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Get more help at https://help.gradle.org. BUILD FAILED in 8s.
info Run CLI with --verbose flag for more details.
npm ERR! Lifecycle script `android` failed with error:
npm ERR! Error: command failed
npm ERR! in workspace: @react-native/[email protected]
npm ERR! at location: /Users/bikidas/react-native/packages/rn-tester
Reproducer
N/A
Screenshots and Videos
:warning: | Missing Reproducible Example |
---|---|
:information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
cc @cortinico
@Biki-das, looks like the build script is unable to locate the temp lib directory at this point:
pushd "$TMP_DIR" >/dev/null
# Note: this automatically runs build as well.
"$YARN_BINARY" install 2> >(grep -v '^warning' 1>&2)
popd >/dev/null
$EDEN_SAFE_MV "$TMP_DIR/lib" "$CODEGEN_DIR"
? Are you able to build the android rn tester app? If yes , could you give a possible solution to my problem, have not made any changes to the repo, on the latest main branch @tarunrajput
@Biki-das what happens if you run:
bash /Users/bikidas/react-native/packages/react-native-codegen/scripts/oss/build.sh
?
@cortinico it installs the script but ends with some no file/directory statement
@cortinico it installs the script but ends with some no file/directory statement
It's failing to move a folder. Can you try to re-clone in a different folder and build again?
@cortinico i tried to clone it in my desktop folder, also tried to create a new folder and tried to clone it there still throws the same error. :-(
@cortinico i tried to clone it in my desktop folder, also tried to create a new folder and tried to clone it there still throws the same error. :-(
Without further context, we can't help you more sadly. As you can see, the react-native project builds successfully on our CI, so this is definitely something related to your local environment.
ok thanks for helping me out, will verify the local environment once more.
closing this @cortinico , it got solved automatically, i recloned again a few times and it worked thanks for resolving :-)