DeviceInfo native module is not installed correctly

安稳与你 提交于 2019-11-30 11:08:32

@kdizzle Make sure you have the right packager running in the terminal, sometimes you may have a packager associated with another react native project running, this happens because when you stop running an xcode RN project, it doesn't stop the packager in the terminal, and when you start/open another RN project in xcode, it simply checks if a packager is running, doesn't check if it's associated with the current project. So make sure you stop all of the packager instances in the terminal and then open the RN project again.

This may happen when upgrading a project to a newer version of react-native. To fix it,

  1. Stop your packager.
  2. Quit your iOS/android simulator.
  3. Reinstall your modules: rm -rf node_modules && npm install
  4. Restart your packager and simulator, e.g. react-native run-ios

I had this issue and it happened when I changed Hardware within the simulator. To fix it I had to kill the packager and run 'react-native run-ios' again. It didn't happen all the time but when it did this fixed it for me!

Another use is in a Brownfield App. Check your iOS and/or Android react-native versions. If they don't match exactly you will see this error screen too.

For example: I had a react native instance running 0.45.1 while Android had 0.45.0 installed. The solution for me was to make sure everything was running the same version.

None of the above answers have worked for me, so I researched the 'react-native' options a little and ended up:

  1. Deleting the iOS and android folders from the app directory altogether
  2. Running 'react-native eject'
  3. Re-running 'react-native run-ios'

After that the iPhone emulator seemed to have no problem with the app.

This problem would appear when React Native libraries in ios project can not found. I happend to meet this problem when i update my react-native version from 0.42 to 0.44, and cause that a file named RCTConvert+Map disappear in 0.44, so i update my pod. command: pod update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!