Skip to content

[Android] Using relative paths for ENTRY_FILE now end up in build failure #36186

Closed
@DomiR

Description

@DomiR

Description

Before bb02ccf we were able to run ENTRY_FILE="./index.custom.js" npx react-native android --variant="release" but now I get:

* What went wrong:
A problem was found with the configuration of task ':app:createBundleConnectdevReleaseJsAndAssets' (type 'BundleHermesCTask').
  - In plugin 'com.facebook.react' type 'com.facebook.react.tasks.BundleHermesCTask' property 'entryFile' specifies file '$HOME/rn-project/android/app/index.custom.js' which doesn't exist.

It seems that the entry file is now resolved relative to the android root project. Not sure if this was intended.

Version

0.71.3

Output of npx react-native info

System:
    OS: macOS 13.2.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 799.56 MB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.14.0 - ~/.cache/fnm_multishells/16825_1676559821539/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.3.1 - ~/.cache/fnm_multishells/16825_1676559821539/bin/npm
    Watchman: 2023.01.23.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/lib/ruby/gems/3.1.0/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK:
      System Images: android-30 | ARM 64 v8a
      Android NDK: 24.0.8215888
  IDEs:
    Android Studio: 2022.1 AI-221.6008.13.2211.9477386
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.17 - /Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0
    react-native: 0.71.3 => 0.71.3
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

Build release variant while passing in relative path for ENTRY_FILE.

Snack, code example, screenshot, or link to a repository

* What went wrong:
A problem was found with the configuration of task ':app:createBundleConnectdevReleaseJsAndAssets' (type 'BundleHermesCTask').
  - In plugin 'com.facebook.react' type 'com.facebook.react.tasks.BundleHermesCTask' property 'entryFile' specifies file '$HOME/rn-project/android/app/index.custom.js' which doesn't exist.

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