Reputation: 1596
May be this query is solved long back but I'm unable to find the solution
Trying to debug react-native app with the help of http://localhost:8081/debugger-ui/. For this i've deployed the app in android emulator, clicked ctrl + m
| chose Debug
option but ended up with below error
Invariant Violation: Calling synchronous methods on native modules is not supported in Chrome, Consider providing alternative methods to expose this method in debug mode, e.g. by exposing constants ahead-of-time, Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
To solve this, i gone through link1, link2, link3, link4 but unable to solve. Can anyone help in this.
Upvotes: 2
Views: 3232
Reputation: 1596
Warning: Follow this only for debugging (which is not depended on DeviceInfo)
After looking into this, searched whole project for react-native-device-info
imports and found in two places and initialised like this
const uniqueId = DeviceInfo.getUniqueIdSync();
const appVersion = DeviceInfo.getVersionSync();
Commented these two lines and assigned some dummy values like
const uniqueId = `device`;
const appVersion = `device`;
then able to debug the app
Upvotes: 1