3
votes

After creating my React-Native project with the following command :

npx react-native init AwesomeProject

When I want to run the project with the following command

npx react-native run-android

I get the following error :

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.

Jetifier found 864 file(s) to forward-jetify. Using 8 workers... info Starting JS server...

error ENOENT: no such file or directory, open 'app\build\intermediates\merged_manifests\debug\AndroidManifest.xml'. Run CLI with --verbose flag for more details.

Error: ENOENT: no such file or directory, open 'app\build\intermediates\merged_manifests\debug\AndroidManifest.xml' at Object.openSync (fs.js:456:3) at Object.readFileSync (fs.js:358:35) at getLaunchPackageName (C:\Users\Angular\Desktop\React-Native\AwesomeProject120\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\getLaunchPackageName.js:161:33) at buildAndRun (C:\Users\Angular\Desktop\React-Native\AwesomeProject120\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:163:63) at C:\Users\Angular\Desktop\React-Native\AwesomeProject120\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:135:12 at processTicksAndRejections (internal/process/task_queues.js:97:5) at async Command.handleAction (C:\Users\Angular\Desktop\React-Native\AwesomeProject120\node_modules\react-native\node_modules@react-native-community\cli\build\index.js:182:9)

I tried uninstalling the package and reinstalling but It does not work.

EDIT:

there is a package named @react-native-community in the node_modules folder, when I used @react-native-community package of my previous project and replace, It worked perfectly

my package.json

{
  "name": "AwesomeProject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "react": "16.9.0",
    "react-native": "0.61.5"
  },
  "devDependencies": {
    "@babel/core": "^7.6.2",
    "@babel/runtime": "^7.6.2",
    "@react-native-community/eslint-config": "^0.0.5",
    "babel-jest": "^24.9.0",
    "eslint": "^6.5.1",
    "jest": "^24.9.0",
    "metro-react-native-babel-preset": "^0.56.0",
    "react-test-renderer": "16.9.0"
  },
  "jest": {
    "preset": "react-native"
  }
}
5

5 Answers

3
votes

NOTE

The issue has been fixed by the react-native-community team, so this fix is not required anymore.

Original answer below

There seems to be an issue with the latest version of @react-native-community/cli-platform-android 3.1.1.

I have resolved my issue by downgrading to an older version of the library by adding this to my package.json.

  "resolutions": {
    "@react-native-community/cli-platform-android": "2.9.0"
  }

After that, remove the node_modules folder and run yarn or npm install again.

1
votes

there is a package named @react-native-community in the node_modules folder, when I used @react-native-community package of my previous project and replace, It worked perfectly

It's work for me

1
votes

Same problem, fresh react native project Had to replace @react-native-community folder to a previous working one

1
votes

The only way I found, that worked for me, was to follow the suggestions from Github found here: https://github.com/react-native-community/cli/issues/967

The resolution was to add "@react-native-community/cli-platform-android": "3.0.3" to my dependencies in my package.json file.

0
votes

try to run: "cd android" "./gradlew assembleDebug" "cd .." "npx react-native run-android"