react-native: Problems during react-native run-android

Environment

React Native Environment Info: System: OS: Windows 10 CPU: x64 Intel® Core™ i5-5200U CPU @ 2.20GHz Memory: 827.14 MB / 7.90 GB Binaries: Yarn: 1.9.2 - C:\Users\Lucas\AppData\Roaming\npm\yarn.CMD npm: 6.2.0 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 3.1.0.0 AI-173.4697961

Description

I was trying to build and run my first react-native project on an AVD running android-studio AVD, have emulated a device and, when I did react-native run-android, it started to compiled the code. Something happened at the AVD and I got the following error:

The development server returned response error code: 500

URL: http://10.0.2.2:8081/index.delta?platform=android&dev=true&minify=false

Body:

{"originModulePath":"C:\\Users\\Lucas\\Desktop\\testes\\teste\\node_modules\\react-native\\Libraries\\react-native\\react-native-implementation.js","targetModuleName":"AccessibilityInfo","message":"Unable to resolve module `AccessibilityInfo` from `C:\\Users\\Lucas\\Desktop\\testes\\teste\\node_modules\\react-native\\Libraries\\react-native\\react-native-implementation.js`: Module `AccessibilityInfo` does not exist in the Haste module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n  1. Clear watchman watches: `watchman watch-del-all`.\n  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.\n  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.","errors":[{"description":"Unable to resolve module `AccessibilityInfo` from `C:\\Users\\Lucas\\Desktop\\testes\\teste\\node_modules\\react-native\\Libraries\\react-native\\react-native-implementation.js`: Module `AccessibilityInfo` does not exist in the Haste module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n  1. Clear watchman watches: `watchman watch-del-all`.\n  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.\n  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`."}],"name":"Error","stack":"Error: Unable to resolve module `AccessibilityInfo` from `C:\\Users\\Lucas\\Desktop\\testes\\teste\\node_modules\\react-native\\Libraries\\react-native\\react-native-implementation.js`: Module `AccessibilityInfo` does not exist in the Haste module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n  1. Clear watchman watches: `watchman watch-del-all`.\n  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.\n  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.\n    at ModuleResolver.resolveDependency (C:\\Users\\Lucas\\Desktop\\testes\\teste\\node_modules\\metro\\src\\node-haste\\DependencyGraph\\ModuleResolution.js:167:1306)\n    at ResolutionRequest.resolveDependency (C:\\Users\\Lucas\\Desktop\\testes\\teste\\node_modules\\metro\\src\\node-haste\\DependencyGraph\\ResolutionRequest.js:80:16)\n    at DependencyGraph.resolveDependency (C:\\Users\\Lucas\\Desktop\\testes\\teste\\node_modules\\metro\\src\\node-haste\\DependencyGraph.js:237:485)\n    at Object.resolve (C:\\Users\\Lucas\\Desktop\\testes\\teste\\node_modules\\metro\\src\\lib\\transformHelpers.js:116:25)\n    at dependencies.map.result (C:\\Users\\Lucas\\Desktop\\testes\\teste\\node_modules\\metro\\src\\DeltaBundler\\traverseDependencies.js:298:29)\n    at Array.map (<anonymous>)\n    at resolveDependencies (C:\\Users\\Lucas\\Desktop\\testes\\teste\\node_modules\\metro\\src\\DeltaBundler\\traverseDependencies.js:294:16)\n    at C:\\Users\\Lucas\\Desktop\\testes\\teste\\node_modules\\metro\\src\\DeltaBundler\\traverseDependencies.js:159:33\n    at Generator.next (<anonymous>)\n    at step (C:\\Users\\Lucas\\Desktop\\testes\\teste\\node_modules\\metro\\src\\DeltaBundler\\traverseDependencies.js:239:307)"}
processBundleResult
    BundleDownloader.java:285
access$200
    BundleDownloader.java:37
onResponse
    BundleDownloader.java:163
execute
    RealCall.java:153
run
    NamedRunnable.java:32
runWorker
    ThreadPoolExecutor.java:1167
run
    ThreadPoolExecutor.java:641
run
    Thread.java:764

Reproducible Demo

Let us know how to reproduce the issue. Include a code sample, share a project, or share an app that reproduces the issue using https://snack.expo.io/. Please follow the guidelines for providing a MCVE: https://stackoverflow.com/help/mcve

cd C:\Users\[Your_username]\Desktop
mkdir testes
cd testes
react-native init teste
cd teste
[now, run a virtual device on Android Studio]
react-native run-android

[the error will appear on AVD screen

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 24 (1 by maintainers)

Most upvoted comments

Use 0.55.4 version instead. 0.56 is not working on windows.

@Tchanu Thank dude, It helped a lot. it fixed my problem for now.

Yet I’m waiting for react-native 0.57.0 to start my main project

yes, it’s very easy to reproduce. But the issue happens not only on android simulator: it happened also on my own android mobile

This issue have been opened, yes is a duplicate of #14209 but #14209 for some reason have been CLOSED, which is odd, the issue remains very relevant at this point in time the latest React-Native cannot run-android on a simulator.

Duplicate of #14209

To be honest, I don’t remember. Because I’m not an expert on react native (actually I know nothing, I’ve just started to study it), and I did so many things trying to solve it that I lost myself on what I did and what I didn’t do. The thing is: 0.55.4 works fine. 0.56 don’t.

And I agree that one of the issues (mine or the one which has been closed) must remain open, for people to discuss about it and try to solve. Because it makes no sense to have a later version, but not be able to use

Well, there’s something wrong with react-native 0.56 . I tried to use version 0.55.4 and it worked really fine! Thanks @jeroentrappers and @Tchanu .

I tryied to run the code on my own Android phone, and got the very same error. I tryied to run the suggestions listed on the error, but for all of the command on the steps, I’ve got that "watchman isn’t recognized as an internal command or external, an operable program