question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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® Core™ 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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
troZeecommented, Apr 9, 2020

I encountered the same issue and I resolved it as follow: I created react-native.config.js file in root dir (at the same level as package.json file ), which contains below code:

module.exports = {
  project: {
    android: {
      sourceDir: './example/android',
    },
  },
};

Where android project is located inside './example/android You can also check all dirs using react-native config command.

0reactions
thymikeecommented, Apr 20, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

The app.root and site.path services are invalid - Drupal
Problem /Motivation The class is set to SplString which is a PECL only class. It simply doesn't exist. Try php --rc SplString.
Read more >
Android: Project 'MyProject' not found in root project 'MyProject'
Solution · Ensure the Root-Project's files are placed in a sub-folder of root-folder, for example, let's call it "app" folder. · Then import...
Read more >
Troubleshoot ongoing server discovery, software inventory ...
This article helps you troubleshoot issues with ongoing server discovery, software inventory, and discovery of SQL Server instances and ...
Read more >
APKs (apps) to disable - bloatware (non-root and root)
You have to read the instructions to enable it to work rootless-ly, but it does work (it uses device administrator permissions). Before granting ......
Read more >
ROOT Version 6.24 Release Notes
The main goal of this package is to support running any RDataFrame application distributedly. Nonetheless, not all RDataFrame operations ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found