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

RNDeviceInfo is null on Android and react-native #1625

Open
Kohlroulade opened this issue Mar 25, 2024 · 7 comments
Open

RNDeviceInfo is null on Android and react-native #1625

Kohlroulade opened this issue Mar 25, 2024 · 7 comments

Comments

@Kohlroulade
Copy link

Kohlroulade commented Mar 25, 2024

Summary

Version 10.13.1
Affected OS Android
OS Version 10

Current behavior

Running expo using npx expo start. Start app on my smartphone. Get following error:

ERROR Error: react-native-device-info: NativeModule.RNDeviceInfo is null. To fix this issue try these steps:
• For react-native <= 0.59: Run react-native link react-native-device-info in the project root.
• Rebuild and re-run the app.
• If you are using CocoaPods on iOS, run pod install in the ios directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods.
If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-device-info/react-native-device-info, js engine: hermes
ERROR Invariant Violation: "main" has not been registered. This can happen if:

  • Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and AppRegistry.registerComponent wasn't called., js engine: hermes

Expected behavior

App should start on smartphone

I am using react-native 0.73.4

@GemsGame
Copy link

the same issue

@rahulinaction
Copy link

As added in the Readme there is possibly manual linking done in your project. Try to get rid of the includes and try installing module followed by pod install. That did the trick for me

@Kohlroulade
Copy link
Author

As added in the Readme there is possibly manual linking done in your project. Try to get rid of the includes and try installing module followed by pod install. That did the trick for me

Eeeeehm, I didn't implement any linking, and from the README I guess this is done automatically as of react-native >0.59. Apart from this I don't use CocoaPods nor have I any pod-file.

@rethink-alexandrejunior

the same issue, somebody ?

Captura de Tela 2024-03-28 às 18 39 39

@Larry-Schultz
Copy link

Larry-Schultz commented Apr 21, 2024

Also experiencing this issue.

I'm using React version 0.73.6 I'm not using CocoaPods nor am I using Xcode since I'm working on an Android project. What am I supposed to do to resolve this issue?

@pnthach95
Copy link

react-native: 0.73.7
react-native-device-info: 10.13.2

Reproducer: https://github.com/pnthach95/applicationIdError

Screen.Recording.2024-04-28.at.12.46.36.PM.mov

@mikehardy
Copy link
Collaborator

@rethink-alexandrejunior

the same issue, somebody ?

"the same issue" - you all realize you have like 3 issues all mixed on this one thread? It shows an inattention to detail when the issues are clearly different - reading was not performed 👀

Captura de Tela 2024-03-28 às 18 39 39

@rethink-alexandrejunior that looks like unit tests, and you are likely missing a mock implementation - I believe one is shipped with this package for this package

Separately:

  • Expo issue - I don't use expo, expo people will have to figure that out

And finally:

  • @pnthach95 it works in CI, it works in my apps, you have some project-specific problem. What it is, I am not sure, but it will not result in a change here. I realize you made a reproduction repo and I do appreciate that - I gave it a brief glance - and I see your video, but something doesn't seem right as I have no problem with this module in my projects 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants