Skip to content

Task :app:createBundleDevDebugJsAndAssets FAILED #53888

@ajayclk115-beep

Description

@ajayclk115-beep

Description

I am experiencing build failures when running the Android app on React Native 0.81.4. The main error encountered is:

text

Task :app:createBundleDevDebug FAILED
...
Execution failed for task ':app:createBundleDevDebugAssets'.
Process 'node' finished with non-zero exit value 2
...
Error: ENOENT: no such file or directory, open '.../build/generated/android/index.bundle'
The Gradle build expects the JS bundle file index.bundle at build/generated/android/index.bundle but it is missing/not generated during the build process. This causes the build to fail and prevents app installation on the device/emulator.

Environment:
React Native version: 0.81.4

Android Gradle Plugin: 8.1.4

Gradle version: 8.14.3

Hermes enabled: Yes

macOS Big Sur/Monterey (M2 chip)

Steps to reproduce

Verified Metro bundler starts successfully with yarn start and cache reset.

Manually generated bundle using:

bash
npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output ./build/generated/android/index.bundle --assets-dest ./android/app/src/main/res/
Created missing directories build/generated/android manually before building.

Cleaned Gradle and rebuild with:

bash
cd android
./gradlew clean
cd ..
yarn android:dev
Verified and updated Babel config for React Native Reanimated plugin replaced by react-native-worklets/plugin.

Updated Metro config to include proper asset and source extensions.

Ensured no port conflicts with Metro server (killed any process on 8081).

Cleared and reinstalled dependencies with yarn and npm.

Reviewed Gradle build files to confirm correct bundle paths.

React Native Version

0.81.4

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info

ajaykumar@Mac Mobile % npx @react-native-community/cli info
info Fetching system and libraries information...
System:
  OS: macOS 15.6.1
  CPU: (8) arm64 Apple M2
  Memory: 144.45 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 24.7.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 11.5.1
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2025.09.08.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.0
      - iOS 26.0
      - macOS 26.0
      - tvOS 26.0
      - visionOS 26.0
      - watchOS 26.0
  Android SDK:
    API Levels:
      - "30"
      - "31"
      - "33"
      - "34"
      - "35"
      - "36"
    Build Tools:
      - 30.0.2
      - 30.0.3
      - 33.0.0
      - 34.0.0
      - 35.0.0
      - 35.0.1
      - 36.0.0
    System Images:
      - android-35 | Intel x86_64 Atom
      - android-36 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.3 AI-243.26053.27.2432.13536105
  Xcode:
    version: 26.0/17A324
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.16
    path: /opt/homebrew/Cellar/openjdk@17/17.0.16/libexec/openjdk.jdk/Contents/Home/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.2
    wanted: 20.0.2
  react:
    installed: 19.1.1
    wanted: 19.1.1
  react-native:
    installed: 0.81.4
    wanted: ^0.81.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: false

ajaykumar@Mac  %

Stacktrace or Logs

> Task :app:createBundleDevDebugJsAndAssets FAILED

[Incubating] Problems report is available at: file:///Users/ajaykumar/Documents/Comviva/Ajay-workspace/Momo-Business-upgrade/MoMo4Business-Mobile/android/build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.14.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
78 actionable tasks: 68 executed, 10 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx 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 

No modules to process in combine-js-to-schema-cli. If this is unexpected, please check if you set up your NativeComponent correctly. See combine-js-to-schema.js for how codegen finds modules.
No modules to process in combine-js-to-schema-cli. If this is unexpected, please check if you set up your NativeComponent correctly. See combine-js-to-schema.js for how codegen finds modules.
[Error: ENOENT: no such file or directory, open '/Users/ajaykumar/Documents/Comviva/Ajay-workspace/Momo-Business-upgrade/MoMo4Business-Mobile/build/generated/android/index.bundle'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/ajaykumar/Documents/Comviva/Ajay-workspace/Momo-Business-upgrade/MoMo4Business-Mobile/build/generated/android/index.bundle'
}

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:createBundleDevDebugJsAndAssets'.
> Process 'command 'node'' finished with non-zero exit value 2

* 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 40s
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDevDebug -PreactNativeDevServerPort=8081
No modules to process in combine-js-to-schema-cli. If this is unexpected, please check if you set up your NativeComponent correctly. See combine-js-to-schema.js for how codegen finds modules.
No modules to process in combine-js-to-schema-cli. If this is unexpected, please check if you set up your NativeComponent correctly. See combine-js-to-schema.js for how codegen finds modules.
[Error: ENOENT: no such file or directory, open '/Users/ajaykumar/Documents/Comviva/Ajay-workspace/Momo-Business-upgrade/MoMo4Business-Mobile/build/generated/android/index.bundle'] { errno: -2, code: 'ENOENT', syscall: 'open', path: '/Users/ajaykumar/Documents/Comviva/Ajay-workspace/Momo-Business-upgrade/MoMo4Business-Mobile/build/generated/android/index.bundle'
} FAILURE: Build failed with an exception. * What went wrong:
Execution failed for task ':app:createBundleDevDebugJsAndAssets'.
> Process 'command 'node'' finished with non-zero exit value 2 * 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 40s.
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ajaykumar@Mac MoMo4Business-Mobile %

MANDATORY Reproducer

https://github.com/react-native-community/reproducer-react-native

Screenshots and Videos

Observations:
The error persists even after manual bundle generation and directory creation.

createBundle* Gradle task looks for bundle in build/generated/android/index.bundle which may not be the standard output path used by Metro bundler.

Dependencies, especially Native Modules or codegen, seem to cause warnings, but not directly linked to this.

Hermes executable path misalignment noted but secondary.

Yarn install occasionally fails due to corrupt cache; this was worked around.

CocoaPods install for iOS sometimes fails due to network timeout

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions