Reputation: 7335
I'm trying to remove react-native-device-info
from our React Native project (in favor of the smaller react-native-version-number
).
I've taken these steps:
However, when I run the app I still get these errors. What am I missing?
[Thu Jul 23 2020 14:20:30.622] ERROR Error: @react-native-community/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-community/react-native-device-info
[Thu Jul 23 2020 14:20:30.623] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
[Thu Jul 23 2020 14:20:31.746] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
Upvotes: 3
Views: 6354
Reputation: 7335
In the current version of react-native, just removing the dependency from package.json and running pod install
should work. No manual unlinking is necessary.
We added a yarn postinstall script in package.json as well to always run pod install:
"postinstall": "(cd ios && pod install)",
Upvotes: 3
Reputation: 709
react-native unlink react-native-device-info
You need to remove react-native-device-info
from your codebase as well, you probably still import it in some file. Also when removing pods remember to reinstall the app and restart the bundler.
Upvotes: 1