android - React native 应用程序仅在发布版本时崩溃

标签 android reactjs react-native sms

我使用 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/

相关文章:

java - 文件下载为 html 而不是我想要下载的文件,如何解决此问题?

java - 我正在集成一个 android API,在以下情况下一直无法生成 xwsse token

android - Xamarin 示例应用程序不显示任何内容

javascript - 如何对 ReactJS 组件中的入站 Prop 进行排序?

javascript - React-Native:错误:需要 JDK11 或更高版本。检测到不兼容的主要版本: '8'

javascript - 将react-native从 0.68 升级到 0.69 时,出现此错误

react-native - 无法下载 React Canvas 绘图

Android:以编程方式设置首选项

node.js - 如何仅在提交更改后而不是更改期间提交更新的照片?

javascript - (REACT) 如何从数组创建动态选择选项列表