Skip to content

App root automatic discovery not working when --root option did #1100

@vonovak

Description

@vonovak

Environment

react-native info unfortunately does not produce fully valid results in my case. The valid part is

here

System:
OS: macOS 10.15.3
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 1.23 GB / 16.00 GB
Shell: 5.0.11 - /usr/local/bin/bash
Binaries:
Node: 12.14.1 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.13.7 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.8.4 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
Android NDK: 17.2.4988734
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6308749
Xcode: 11.4/11E146 - /usr/bin/xcodebuild

Description

In https://github.com/react-native-community/datetimepicker there is an example project in the example folder. I'm using the kind of setup that it common in many of the community repositories where the example app links to the native and js code which is in the parent folder.

In the master branch with RN 0.60.4, I'm able to run react-native run-android --root example/ and get the build running.

In the @vonovak/enable-detox branch which uses RN 0.62.1 and @react-native-community/cli@^4.5.1 , if I run the same command, I get

Error: ENOENT: no such file or directory, open '/src/main/AndroidManifest.xml'
    at Object.openSync (fs.js:440:3)
    at Object.readFileSync (fs.js:342:35)
    at buildAndRun (/Users/vojta/dev/_own/datetimepicker/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:162:41)
    at /Users/vojta/dev/_own/datetimepicker/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:146:12
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
    at async Command.handleAction (/Users/vojta/dev/_own/datetimepicker/node_modules/@react-native-community/cli/build/index.js:186:9)

(yes, the file is not there). It would be nice to have some more docs about how the detection works https://github.com/react-native-community/cli/blob/master/docs/commands.md#--root-string

Reproducible Demo

https://github.com/react-native-community/datetimepicker @vonovak/enable-detox branch

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions