Press "Enter" to skip to content

React Native Issue: Unable to resolve module `AccessibilityInfo`

0

Last updated on 24 Jul 2018

Unable to resolve module `AccessibilityInfo`

Issue
I basically just cloned an existing project with a minimal setup, did yarn install and node node_modules/react-native/local-cli/cli.js run-ios. It started but the packer failed with:

error: bundling: UnableToResolveError: Unable to resolve module `AccessibilityInfo` from `/Users/phillipp/Work/***/***/node_modules/react-native/Libraries/react-native/react-native-implementation.js`: Module does not exist in the module map or in these directories:
  /Users/phillipp/Work/***/***/node_modules/react-native/node_modules
,   /Users/phillipp/Work/***/***/node_modules

I found get AccessibilityInfo() { return require('AccessibilityInfo'); }, in the /Users/phillipp/Work/***/***/node_modules/react-native/Libraries/react-native/react-native-implementation.js file but I have no clue where it wants to require that from. It seems to be a RN core thing.

The Solution -> Maybe this work.

But this is what I did,

react-native init ProjectName
react-native run-android

If –gave the “AccessibilityInfo module not found” error–

npm uninstall react-native
npm install --save react-native@0.55.4
react-native run-android

If –Error: Plugin 0 specified…–

npm install --save babel-core@latest babel-loader@latest

If –Error: Plugin 0 specified…—

npm uninstall --save babel-preset-react-native
npm install --save babel-preset-react-native@4.0.0

And this started working fine
My current dependencies:

{
  "name": "chartSamples",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "babel-core": "^6.26.3",
    "babel-loader": "^7.1.5",
    "babel-preset-react-native": "^4.0.0",
    "eslint-config-rallycoding": "^3.2.0",
    "react": "16.4.1",
    "react-native": "^0.55.4",
    "react-native-highcharts": "^1.0.2"
  },
  "devDependencies": {
    "babel-jest": "23.4.0",
    "jest": "23.4.0",
    "react-test-renderer": "16.4.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

Also try this solution

react-native init ProjectName --version 0.55.4
react-native run-android

Source : https://github.com/facebook/react-native/issues/14209