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

RN 0.76.5 - Unable to create release build in Android and archive in IOS #48304

Open
codingslash76 opened this issue Dec 17, 2024 · 3 comments
Open
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: Android Android applications. Platform: iOS iOS applications.

Comments

@codingslash76
Copy link

Description

I have upgraded React Native from version 75.2 to version 76.5. However, I am unable to create a release APK for Android or archive for iOS. It works fine in the simulator, and I can generate a debug APK without any issues.

I have tried various solutions, including resetting the system, but nothing seems to work.

Android Studio Ladybug | 2024.2.1 Patch 3
Build #AI-242.23339.11.2421.12700392, built on November 22, 2024

Related bug and solution, but nothing works:
https://stackoverflow.com/questions/49513047/react-native-assemblerelease-fails-for-task-appbundlereleasejsandassets

#28510

#35583

https://stackoverflow.com/questions/59830079/apk-failing-to-build-release-because-of-bundlereleasejsandassets

https://stackoverflow.com/questions/56799468/task-bundlereleasejsandassets-not-found-in-root-project

Steps to reproduce

{
  "name": "AwesomeApp",
  "version": "3.14.0",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint .",
    "postinstall": "patch-package"
  },
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^6.7.1",
    "@fortawesome/free-brands-svg-icons": "^6.7.1",
    "@fortawesome/free-solid-svg-icons": "^6.7.1",
    "@fortawesome/pro-duotone-svg-icons": "^6.7.1",
    "@fortawesome/pro-light-svg-icons": "^6.7.1",
    "@fortawesome/pro-regular-svg-icons": "^6.7.1",
    "@fortawesome/pro-solid-svg-icons": "^6.7.1",
    "@fortawesome/react-native-fontawesome": "^0.3.2",
    "@fortawesome/sharp-light-svg-icons": "^6.7.1",
    "@fortawesome/sharp-regular-svg-icons": "^6.7.1",
    "@gorhom/bottom-sheet": "^4.6.4",
    "@react-native-async-storage/async-storage": "^2.1.0",
    "@react-native-camera-roll/camera-roll": "^7.9.0",
    "@react-native-community/blur": "^4.4.1",
    "@react-native-community/datetimepicker": "^8.2.0",
    "@react-native-community/geolocation": "^3.4.0",
    "@react-native-community/netinfo": "^11.4.1",
    "@react-native-community/slider": "^4.5.5",
    "@react-native-firebase/app": "^18.7.3",
    "@react-native-firebase/messaging": "^18.7.3",
    "@react-native-picker/picker": "^2.4.0",
    "@react-navigation/drawer": "^6.7.2",
    "@react-navigation/native": "^6.1.18",
    "@react-navigation/stack": "^6.4.1",
    "@stripe/stripe-react-native": "^0.38.4",
    "axios": "^1.7.2",
    "buffer": "^6.0.3",
    "deprecated-react-native-prop-types": "^2.3.0",
    "fbjs": "^3.0.5",
    "js-sha256": "^0.11.0",
    "lodash": "^4.17.21",
    "moment": "^2.30.1",
    "native-base": "^3.4.28",
    "prop-types": "^15.8.1",
    "react": "18.3.1",
    "react-native": "^0.76.5",
    "react-native-add-calendar-event": "^5.0.0",
    "react-native-blob-util": "^0.19.11",
    "react-native-camera": "^4.2.1",
    "react-native-detector": "^0.2.3",
    "react-native-document-picker": "^9.3.1",
    "react-native-geolocation-service": "^5.3.1",
    "react-native-gesture-handler": "^2.21.2",
    "react-native-image-crop-picker": "^0.41.6",
    "react-native-image-picker": "^7.2.2",
    "react-native-image-viewing": "^0.2.2",
    "react-native-inappbrowser-reborn": "^3.7.0",
    "react-native-indicators": "^0.17.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-linear-gradient": "^2.8.3",
    "react-native-maps": "^1.20.1",
    "react-native-masonry-list": "^2.16.2",
    "react-native-media-controls": "^2.3.0",
    "react-native-modal": "^13.0.1",
    "react-native-modal-datetime-picker": "^18.0.0",
    "react-native-nfc-manager": "^3.16.1",
    "react-native-pdf": "^6.7.6",
    "react-native-permissions": "^5.2.1",
    "react-native-picker-select": "^9.3.1",
    "react-native-qrcode-scanner": "^1.5.5",
    "react-native-qrcode-svg": "^6.3.12",
    "react-native-quick-actions": "^0.3.13",
    "react-native-reanimated": "^3.15.0",
    "react-native-safe-area-context": "^5.0.0",
    "react-native-screens": "^4.3.0",
    "react-native-share": "^12.0.3",
    "react-native-slider": "^0.11.0",
    "react-native-snap-carousel": "^3.9.1",
    "react-native-sound": "^0.11.2",
    "react-native-svg": "^15.10.1",
    "react-native-swipe-gestures": "^1.0.5",
    "react-native-swipe-list-view": "^3.2.9",
    "react-native-swiper": "^1.6.0",
    "react-native-switch-selector": "^2.3.0",
    "react-native-webview": "^13.12.5",
    "react-native-zohodesk-portal-sdk": "^1.3.6",
    "react-redux": "^9.1.2",
    "redux": "^5.0.1",
    "rive-react-native": "^7.3.0",
    "rn-range-slider": "github:githuboftigran/rn-range-slider#v1"
  },
  "devDependencies": {
    "@babel/core": "^7.25.2",
    "@babel/preset-env": "^7.25.3",
    "@babel/runtime": "^7.25.0",
    "@eslint/compat": "^1.2.4",
    "@react-native-community/cli": "15.0.1",
    "@react-native-community/cli-platform-android": "15.0.1",
    "@react-native-community/cli-platform-ios": "15.0.1",
    "@react-native/babel-preset": "0.76.5",
    "@react-native/eslint-config": "0.76.5",
    "@react-native/metro-config": "0.76.5",
    "@react-native/typescript-config": "0.76.5",
    "@types/react": "^18.2.6",
    "@types/react-test-renderer": "^18.0.0",
    "@welldone-software/why-did-you-render": "^8.0.3",
    "babel-jest": "^29.6.3",
    "babel-plugin-module-resolver": "^5.0.2",
    "eslint": "^9.16.0",
    "jest": "^29.6.3",
    "patch-package": "^8.0.0",
    "prettier": "^3.4.2",
    "react-devtools": "^5.3.1",
    "react-devtools-core": "^5.3.1",
    "react-test-renderer": "18.3.1",
    "typescript": "^5.5.4"
  },
  "engines": {
    "node": ">=18"
  },
  "rnpm": {
    "assets": [
      "./assets/fonts"
    ]
  }
}

React Native Version

0.76.5

Affected Platforms

Build - MacOS

Output of npx react-native info

System:
  OS: macOS 15.2
  CPU: (8) arm64 Apple M1
  Memory: 166.66 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 23.4.0
    path: /opt/homebrew/bin/node
  Yarn: Not Found
  npm:
    version: 10.9.2
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12700392
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/bin/javac
  Ruby:
    version: 3.3.6
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.5
    wanted: ^0.76.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

For IOS:
 Welcome to Metro v0.81.0
              Fast - Scalable - Integrated


node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: EMFILE: too many open files, watch
    at FSWatcher._handle.onchange (node:internal/fs/watchers:207:21)
Emitted 'error' event on NodeWatcher instance at:
    at FSWatcher._checkedEmitError (/Users/ashishkumar/copiri-app-amity/node_modules/metro-file-map/src/watchers/NodeWatcher.js:82:12)
    at FSWatcher.emit (node:events:513:28)
    at FSWatcher._handle.onchange (node:internal/fs/watchers:213:12) {
  errno: -24,
  syscall: 'watch',
  code: 'EMFILE',
  filename: null
}

Node.js v23.4.0
Command PhaseScriptExecution failed with a nonzero exit code

For Android

Task :app:createBundleReleaseJsAndAssets FAILED
Execution failed for task ':app:createBundleReleaseJsAndAssets'.
A problem occurred starting process 'command 'node''



### Reproducer

https://github.com/facebook/react-native

### Screenshots and Videos

![Screenshot 2024-12-17 at 11 24 07 AM](https://github.com/user-attachments/assets/b3ff4112-b37d-47b1-8ed1-c5b08c5d2a98)
![Screenshot 2024-12-16 at 9 11 11 PM](https://github.com/user-attachments/assets/2759fe00-1511-4021-87c9-60c71da50c1c)
![Screenshot 2024-12-17 at 5 01 28 PM](https://github.com/user-attachments/assets/63670434-6fa5-4148-a3c2-453137d119f2)
@react-native-bot react-native-bot added Platform: Android Android applications. Platform: iOS iOS applications. Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Dec 17, 2024
@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

@codingslash76
Copy link
Author

I got it working using the following methods:

For iOS:
I completely removed Watchman and then reinstalled it using the command brew install watchman. When that didn't work, I used brew reinstall watchman, and it finally worked.

For Android:
I opened Android Studio using the following command instead of directly launching the application:
open -a /Applications/Android\ Studio.app.

I am unsure about the difference between directly launching the application and launching it using the terminal.

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

@codingslash76
This is likely due to different environment variables being set when you launch Android Studio from the terminal versus from a GUI. Environment variables, like the PATH, determine which binaries can be found and executed. When you launch Android Studio from the terminal, it inherits the environment variables from the terminal session, which likely include the path to Node.js. However, when you open Android Studio from the GUI, it doesn't inherit these terminal environment variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: Android Android applications. Platform: iOS iOS applications.
Projects
None yet
Development

No branches or pull requests

3 participants