Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnableToResolveError: Unable to resolve module AccessibilityInfo #14209

Closed
PhillippOhlandt opened this issue May 26, 2017 · 321 comments
Closed

UnableToResolveError: Unable to resolve module AccessibilityInfo #14209

PhillippOhlandt opened this issue May 26, 2017 · 321 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@PhillippOhlandt
Copy link

Description

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.

Here is the package.json for those who are curious:


{
  "name": "***",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "base64-js": "^1.2.0",
    "react": "^16.0.0-alpha.6",
    "react-native": "^0.44.0",
    "react-native-ble-manager": "^3.2.0",
    "react-native-checkbox": "^1.1.0",
    "react-native-color-picker": "^0.2.1",
    "react-native-drawer": "^2.3.0",
    "react-native-dropdown": "0.0.6",
    "react-native-image-picker": "^0.25.5",
    "react-native-list-popover": "^1.0.5",
    "react-native-modal-picker": "0.0.16",
    "react-native-orientation": "^1.17.0",
    "react-native-router-flux": "^3.37.0",
    "react-native-selectbox": "^0.1.0",
    "react-native-selection": "^1.3.5",
    "react-native-selectme": "^1.2.3",
    "react-native-sound": "^0.9.1",
    "react-native-vector-icons": "^4.0.1"
  },
  "devDependencies": {
    "babel-jest": "18.0.0",
    "babel-preset-react-native": "1.9.1",
    "jest": "18.1.0",
    "react-test-renderer": "~15.4.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

I already tried everything I found on the internet (reinstalling node modules, cleaning npm, yarn and watchman caches, deleting react files from temp dir, etc.)

Additional Information

  • React Native version: ^0.44.0
  • Platform: ios
  • Development Operating System: OSX
  • Dev tools: XCode Version 8.0 (8A218a)
@ne0fite
Copy link

ne0fite commented May 26, 2017

Same issue here. A project I created 2 days ago still works. A new project I created today with react-native init does not. In my case, the difference is the react-native version went from 0.44.0 to 0.44.2. On the new project, if I change the react-native version in package.json to 0.44.0, it works.

@lenichols
Copy link

Same issue suddenly after runing init... :-(

@juanchoperezj
Copy link

Same issue here

@hramos
Copy link
Contributor

hramos commented May 26, 2017

Does this still occur after deleting node_modules then running npm install?

@juanchoperezj
Copy link

@hramos
I tried removing node_modules and reinstalling and it does not work.

@Kennytian
Copy link

@hramos Thanks your team work!

Yesterday, I use react-native-git-upgrade my project 0.44.0 to 0.44.1, it ok, perfect. but now, i use react-native-git-upgrade my project 0.44.1 to 0.44.2, same issue here.

I think issue in the react-native 0.44.1 upgrade to 0.44.2

@valinaga
Copy link

same here. but after downgrading from 0.44.2 to 0.44.1 the issue vanished and everything is back to normal.

@kingctan
Copy link

same here.

@acomagu
Copy link

acomagu commented May 27, 2017

same error on android

@vitaliiznak
Copy link

same on android, removing node_modules and reinstalling and it does not work

@luizguilhermefr
Copy link

Same here. Almost entire team stuck by this error.

@lcszulpo
Copy link

Same here

@vinujan59
Copy link

same here, any solutions?

@mkhalil49
Copy link

same here

@sirgalleto
Copy link

I've downgraded to v 0.44.0 and everything it's working well.

@RohanVB
Copy link

RohanVB commented May 28, 2017

@sirgalleto I'm not sure if downgrading to v0.44.0 would be the solution, since that's the version which @PhillippOhlandt is using. I'm pretty sure it could be something along these lines: aksonov/react-native-router-flux#1904 which would just involve changing the requirements on the react-native-router-flux package.

@valinaga
Copy link

@RohanVB, @sirgalleto moving to 0.44.1 is ok, if you have trouble with 0.44.0.

@RohanVB
Copy link

RohanVB commented May 28, 2017

@valinaga I don't think it's an issue with the react-native package version, it's with react.
The support for router-flux doesn't extend to 16.0.0-alpha.6 at the moment.

@avocadoslab
Copy link

Having same issue with "http" module. I'm on v0.44.0

@hramos
Copy link
Contributor

hramos commented May 30, 2017

Please refrain from adding "me too" comments unless you're providing additional details to aid with a repro. I suggest that instead you subscribe to the issue and add a reaction to the original post. Thanks!

@wonsikin
Copy link

same here. But disappear when I use npm instead of yarn.

@mmmurf
Copy link

mmmurf commented Jun 2, 2017

@hramos I think people are just trying to express their sense of panic about issues like this :)

@joncursi
Copy link
Contributor

joncursi commented Jun 6, 2017

I just hit this upgrading from 0.44.2 -> 0.44.3

@JasonGore
Copy link

This just happened to me and it was because I had a hung 'node' process on port 8081, preventing a new instance of react packager from starting. I did killall -9 node and then was fine.

@ashokseervidev
Copy link

ashokseervidev commented Jun 9, 2017

change it to "react-native": "0.44.0",
delete react-native and install again.

Thakns @ne0fite

@hramos
Copy link
Contributor

hramos commented Jun 9, 2017

We're now at 0.45, which does have its own issue (#14246). Let's wait for #14246 to be fixed and then I'll recommend you use 0.45.

@abdhx
Copy link

abdhx commented Jul 19, 2018

@skrajath that's weird 😶😶

@skrajath
Copy link

@abinax That's weird, yes. The assets folder was missing android/app/src/main/assets , after creating it, everything works just fine. I finally see the app loaded up clean.

@Johncy1997
Copy link

i solved the error as per @ws7one comment.

After that i installed native-base and react-navigation.Simply it shows blank screen.Then changed native-base version to 2.3.5 but react-navigation is not working.

Please someone post the solution

@lahed
Copy link

lahed commented Jul 21, 2018

Work @abinax, thanks
@Johncy1997
My package.json

{
  "name": "AppName",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "moment": "^2.22.2",
    "native-base": "^2.7.2",
    "react": "16.4.1",
    "react-apollo": "^2.1.9",
    "react-native": "0.55.4",
    "react-navigation": "^2.8.0"
  },
  "devDependencies": {
    "babel-eslint": "^8.2.6",
    "babel-jest": "23.4.0",
    "babel-preset-react-native": "4.0.0",
    "eslint": "^4.19.1",
    "eslint-config-airbnb": "^17.0.0",
    "eslint-plugin-import": "^2.13.0",
    "eslint-plugin-jsx-a11y": "^6.1.1",
    "eslint-plugin-react": "^7.10.0",
    "jest": "23.4.1",
    "prettier-eslint": "^8.8.2",
    "react-test-renderer": "16.4.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

@sarveshcchauhan
Copy link

sarveshcchauhan commented Jul 21, 2018

I have found out the solution Follow the links
and check out my comments to resolve ur problem
https://stackoverflow.com/questions/48756550/unable-to-resolve-module-accessibilityinfo-when-trying-to-create-release-bund/51436043#51436043

@Hemant-Synerzip
Copy link

Just downgrade react-native version to "react-native": "0.55.4"

@abdhx
Copy link

abdhx commented Jul 21, 2018

@Hemant-Synerzip downgrading the react native version only is not a solution 😑. Did you read the replays above??

@joper30
Copy link

joper30 commented Jul 23, 2018

Esto funciono para mi : { "name": "demo21", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest" }, "dependencies": { "react": "16.3.1", "react-native": "0.55.4" }, "devDependencies": { "babel-jest": "22.4.1", "babel-preset-react-native": "4.0.0", "jest": "22.4.2", "react-test-renderer": "16.3.1" }, "jest": { "preset": "react-native" } }

@prashaddey
Copy link

prashaddey commented Jul 24, 2018

I solved this issue easily by following the below steps,

  1. I copied dependencies and devDependencies of package.json file from another project that was working fine.
{
  "name": "NameOfYourProject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.3.1",
    "react-native": "0.55.4"
  },
  "devDependencies": {
    "babel-jest": "23.2.0",
    "babel-preset-react-native": "4.0.0",
    "jest": "23.2.0",
    "react-test-renderer": "16.3.1"
  },
  "jest": {
    "preset": "react-native"
  }
}
  1. I deleted the node_modules folder from the main project folder

  2. Then, I re-installed node by,
    npm install --save
    react-native run-android

It will downgrade all the necessary dependencies including "react-native". :)

@maieonbrix
Copy link

I'd like to say that I solved this issue by switching to yarn. I didn't encounter this issue since the switch (1 year ago, you can see one of my post in the beginning of this thread)

Even today If I save a dependency using npm by mistake it will delete some dependency and the project will now longer build due to X module being not here

@ZakariaAhmed
Copy link

how have this not been fixed now at react-native 0.56.0 and this issue is very much present

@slang25
Copy link

slang25 commented Jul 28, 2018

I abandoned RN for Xamarin Forms 3 weeks ago, this was the final straw for me

@williamdarkocode
Copy link

I am really about to move a project I've being working on for months, form RN to Flutter. This is a waste of time. Such an incompetent language.

@rares-lupascu
Copy link

@williamdarkocode the language is not incompetent ... maintainers are ... either incompetent or they really do not give a ... maybe they have already moved to native or flutter and do not care anymore :) ... and when it comes to communication ... they really lack any skill

@prashaddey
Copy link

Anyone here tried Native Script for Vue..? I'm thinking to convert my projects to Native Script - Vue because React Native is throwing all kinds of errors that I've never seen before. Any suggestion would be very much appriciated.

@Johncy1997
Copy link

@lahed

I have tried to downgrade react native and installed the matching versions of native-base and react-navigation.It will accept only react-native pure components.Even it does not support react-native-twitter-signin package.It throws next error regarding SDK version.Each and every time it throws different errors..Even i can't delete my project folder.If i try to delete the folder it throws "the source file name(s) are larger than is supported by the file system.."

someone post the accurate solution for all kinds of error.

@Tchanu
Copy link

Tchanu commented Jul 30, 2018

0.56 seems broken. Use 0.55.4 instead.

@jorius
Copy link

jorius commented Jul 31, 2018

is there any advance on this? I don't know what to do because if I downgrade react-native to 0.55.4 I get stuck by the issue 19126 and if I stay in 0.56 I cannot compile, run on emulator or do anything and the fixes to the issue 19126 doesn't work for me

@PrsRares
Copy link

Why is still closed this issue? No one resolved it yet, all are complaining about this problem. How we resolve it?! I already lost a day of work... I dont understand why its closed.

@gluons
Copy link

gluons commented Jul 31, 2018

@PrsRares Maybe they're working in #19953.

@PrsRares
Copy link

@gluons thx, they didnt make it work, but at least we know now that they cant in this version and it will be fixed in 0.57. Thx.

@williamdarkocode
Copy link

Ok. What worked for me was a little crude but I guess it works so why not.

Instead of doing react-native init, make use create react app, and before installing any dependencies or transferring project directories and files, npm run eject. Don't choose expo eject method. When done ejecting, install all dependencies in your projects package.json, and don't run npm audit fix, no matter the amount of peer dependency errors you see. The reason is when you run npm eject, the core dependencies' versions are to best fit your project. When done with dependencies, simply copy and paste project files, and resolve any errors such as 'Cannot find file/ dir' errors.

@jarvish21
Copy link

"dependencies": {
"react": "^16.4.1",
"react-native": "^0.55.4"
},
"devDependencies": {
"babel-preset-react-native": "^4.0.0",
},
for me even after having following dependencies the error persisted

the below cmds helped me resolve
cd android
gradle clean
cd ..
react-native run-android

@facebook facebook locked as spam and limited conversation to collaborators Aug 2, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Dec 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests