2

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)

enter image description here

To solve this, i gone through link1, link2, link3, link4 but unable to solve. Can anyone help in this.

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.