我使用 react-native-android-sms-listener ( https://github.com/CentaurWarchief/react-native-android-sms-listener ) - 用于收听短信的简单包。但它不适用于发布版本。当收到 SMS 时,我崩溃了,没有错误消息。
在 android 日志中我发现了这个:
ReactNativeJS: undefined is not a function (evaluating 'arguments.[0].indexOf('Requiring module \'NativeModules\' by name')')
在调试版本上总是工作正常。
ReactNative 0.55.4
最佳答案
github.com/facebook/react-native/issues/14364在构建发布之前需要删除所有 console.warn。
或
if (!__DEV__) {
console = {}
console.log = () => null
console.warn = () => null
console.error = () => null
}
关于android - React native 应用程序仅在发布版本时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50483844/