Nicolas
Nicolas

Reputation: 75

React native app is crashing only on release build

I use react-native-android-sms-listener (https://github.com/CentaurWarchief/react-native-android-sms-listener) - simple package for listening sms. But it not working on release build. When SMS recived I have crash without error message.

In android logs I found this:

ReactNativeJS: undefined is not a function (evaluating 'arguments.[0].indexOf('Requiring module \'NativeModules\' by name')')

On the debug build always works fine.

ReactNative 0.55.4

Upvotes: 1

Views: 2058

Answers (1)

Nicolas
Nicolas

Reputation: 75

github.com/facebook/react-native/issues/14364 Need removing all console.warn before building release.

or

if (!__DEV__) {
  console = {}
  console.log = () => null
  console.warn = () => null
  console.error = () => null
}

Upvotes: 3

Related Questions