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

building android build for the react native tester app is failing #44442

Closed
Biki-das opened this issue May 7, 2024 · 11 comments
Closed

building android build for the react native tester app is failing #44442

Biki-das opened this issue May 7, 2024 · 11 comments
Labels
Platform: Android Android applications. Resolution: Answered When the issue is resolved with a simple answer

Comments

@Biki-das
Copy link
Contributor

Biki-das commented May 7, 2024

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
Screenshot 2024-05-07 at 6 43 00 PM

Steps to reproduce

  1. cd react-native , the main react native repository
  2. try yarn android
  3. 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/tester@0.75.0-main
npm ERR!   at location: /Users/bikidas/react-native/packages/rn-tester

Reproducer

N/A

Screenshots and Videos

Screenshot 2024-05-07 at 6 43 00 PM
@github-actions github-actions bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels May 7, 2024
Copy link

github-actions bot commented May 7, 2024

⚠️ Missing Reproducible Example
ℹ️ 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.

@github-actions github-actions bot added the Platform: Android Android applications. label May 7, 2024
@Biki-das
Copy link
Contributor Author

Biki-das commented May 7, 2024

cc @cortinico

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels May 7, 2024
@tarunrajput
Copy link
Contributor

@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"

@Biki-das
Copy link
Contributor Author

Biki-das commented May 7, 2024

? 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

@cortinico
Copy link
Contributor

@Biki-das what happens if you run:

bash /Users/bikidas/react-native/packages/react-native-codegen/scripts/oss/build.sh

?

@cortinico cortinico added Needs: Author Feedback and removed Needs: Attention Issues where the author has responded to feedback. labels May 8, 2024
@Biki-das
Copy link
Contributor Author

Biki-das commented May 8, 2024

@cortinico it installs the script but ends with some no file/directory statement
Screenshot 2024-05-08 at 3 58 42 PM

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels May 8, 2024
@cortinico
Copy link
Contributor

@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?

@Biki-das
Copy link
Contributor Author

Biki-das commented May 12, 2024

@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
Copy link
Contributor

@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.

@cortinico cortinico added Needs: Author Feedback and removed Needs: Attention Issues where the author has responded to feedback. labels May 14, 2024
@Biki-das
Copy link
Contributor Author

ok thanks for helping me out, will verify the local environment once more.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels May 14, 2024
@Biki-das
Copy link
Contributor Author

closing this @cortinico , it got solved automatically, i recloned again a few times and it worked thanks for resolving :-)

@cortinico cortinico added Resolution: Answered When the issue is resolved with a simple answer and removed Needs: Triage 🔍 Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Attention Issues where the author has responded to feedback. labels May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android Android applications. Resolution: Answered When the issue is resolved with a simple answer
Projects
None yet
Development

No branches or pull requests

3 participants