Cli: Cannot run android: No such file or directory, open 'app\build\intermediates\merged_manifests\debug\AndroidManifest.xml'

Created on 14 Feb 2020  ยท  13Comments  ยท  Source: react-native-community/cli

Environment

System:
OS: Windows 10 10.0.18362
CPU: (4) x64 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
Memory: 1.77 GB / 7.86 GB
Binaries:
Node: 12.13.1 - C:\Program Files\nodejs\node.EXE
npm: 6.12.1 - C:\Program Files\nodejs\npm.CMD
SDKs:
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.3
System Images: android-28 | Google APIs Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.6010548
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5

Description

After creating a new react native app using the command

npx react-native init MyAwesomeTSProject --template react-native-template-typescript

when I run the following command

npx react-native run-android

I get the following message:

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 4 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:440:3)
at Object.readFileSync (fs.js:342:35)
at getLaunchPackageName (C:\Workspace\MyAwesomeTSProjectnode_modules\@react-native-community\cli-platform-android\build\commands\runAndroidgetLaunchPackageName.js:161:33)
at buildAndRun (C:\Workspace\MyAwesomeTSProjectnode_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:163:63)
at C:\Workspace\MyAwesomeTSProjectnode_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:135:12
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (C:\Workspace\MyAwesomeTSProjectnode_modulesreact-nativenode_modules\@react-native-community\cli\build\index.js:182:9)

Reproducible Demo

npx react-native init MyAwesomeTSProject --template react-native-template-typescript
cd MyAwesomeTSProject
npx react-native run-android
bug report

Most helpful comment

@grabbou I notice this error still exists while testing the 0.62.0-rc.2 which include the updated android cli, occurs on existing projects and new init RN projects.

โžœ yarn android
yarn run v1.22.0
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 960 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
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'
โ”œโ”€ @react-native-community/[email protected]
โ”œโ”€ @react-native-community/[email protected]
โ”œโ”€ @react-native-community/[email protected]
โ”œโ”€ @react-native-community/[email protected]
โ”œโ”€ @react-native-community/[email protected]
โ””โ”€ @react-native-community/[email protected]
โžœ npx react-native info
info Fetching system and libraries information...
System:
    OS: macOS 10.15.3
    CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
    Memory: 85.88 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.19.0 - ~/.nvm/versions/node/v10.19.0/bin/node
    Yarn: 1.22.0 - /usr/local/bin/yarn
    npm: 6.13.4 - ~/.nvm/versions/node/v10.19.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 23, 26, 27, 28, 29
      Build Tools: 26.0.3, 27.0.3, 28.0.2, 28.0.3, 29.0.2
      System Images: android-22 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.2.1/11B53 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.11.0 => 16.11.0
    react-native: 0.62.0-rc.2 => 0.62.0-rc.2

All 13 comments

I also get this error

Got the same thing. Any possibility of a quick fix?

My friend found a solution

Make sure you npm i react-native-community/cli

For android
-> go to android studio and click "sync project with gradle file"

For ios
-> cd ios and pod install

My friend found a solution

Make sure you npm i react-native-community/cli

For android
-> go to android studio and click "sync project with gradle file"

For ios
-> cd ios and pod install

what is the version of "@react-native-community/cli-platform-android" in your node_modules directory?

cat node_modules/@react-native-community/cli-platform-android/package.json

I had to go back to 3.0.3 to get it working.

@matejdr I'm having the same problem too how did you downgrade to 3.0.3.

My friend found a solution
Make sure you npm i react-native-community/cli
For android
-> go to android studio and click "sync project with gradle file"
For ios
-> cd ios and pod install

what is the version of "@react-native-community/cli-platform-android" in your node_modules directory?

cat node_modules/@react-native-community/cli-platform-android/package.json

I had to go back to 3.0.3 to get it working.

my version is 3.1.1

add "@react-native-community/cli-platform-android": "3.0.3" to your package.json file, under dependancies

then run npm install

this is a temp solution I guess, I hope the library gets fixed in a new release and then this, lock to version, should be removed from package.json

My friend found a solution
Make sure you npm i react-native-community/cli
For android
-> go to android studio and click "sync project with gradle file"
For ios
-> cd ios and pod install

what is the version of "@react-native-community/cli-platform-android" in your node_modules directory?

cat node_modules/@react-native-community/cli-platform-android/package.json

I had to go back to 3.0.3 to get it working.

my version is 3.1.1

yeah, 3.1.1 does not work for me

i found a solution
package.json

"dependencies": {
"@react-native-community/cli-platform-android": "3.0.3" //ADD
}

Add this to package.json solved this issue for me.

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

My package.json

"dependencies": {
    "@react-native-community/cli-platform-android": "3.0.3",
    "react": "16.9.0",
    "react-native": "0.61.5",
  },
  "resolutions": {
    "@react-native-community/cli-platform-android": "3.0.3"
  },

Hope this solve you issue

3.1.2 released with a fix. This issue is caused by a commit that is part of 4.x and we specifically wanted to release it as a part of RC to have some additional time to test that change. Looks like the build caches were not properly cleared while releasing 4.x and 3.x with lerna.

@grabbou I notice this error still exists while testing the 0.62.0-rc.2 which include the updated android cli, occurs on existing projects and new init RN projects.

โžœ yarn android
yarn run v1.22.0
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 960 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
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'
โ”œโ”€ @react-native-community/[email protected]
โ”œโ”€ @react-native-community/[email protected]
โ”œโ”€ @react-native-community/[email protected]
โ”œโ”€ @react-native-community/[email protected]
โ”œโ”€ @react-native-community/[email protected]
โ””โ”€ @react-native-community/[email protected]
โžœ npx react-native info
info Fetching system and libraries information...
System:
    OS: macOS 10.15.3
    CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
    Memory: 85.88 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.19.0 - ~/.nvm/versions/node/v10.19.0/bin/node
    Yarn: 1.22.0 - /usr/local/bin/yarn
    npm: 6.13.4 - ~/.nvm/versions/node/v10.19.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 23, 26, 27, 28, 29
      Build Tools: 26.0.3, 27.0.3, 28.0.2, 28.0.3, 29.0.2
      System Images: android-22 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.2.1/11B53 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.11.0 => 16.11.0
    react-native: 0.62.0-rc.2 => 0.62.0-rc.2
Was this page helpful?
0 / 5 - 0 ratings

Related issues

tallpants picture tallpants  ยท  4Comments

patrickkempff picture patrickkempff  ยท  4Comments

mauricioscotton picture mauricioscotton  ยท  3Comments

owinter86 picture owinter86  ยท  3Comments

Jyrno42 picture Jyrno42  ยท  4Comments