繁体   English   中英

React 本机 iOS 应用程序 - 在发布模式下崩溃

[英]React native iOS app - crashing on release mode

嗨,我是本机反应的新手并尝试进行发布构建。 我已将 jsCodeLocation 更改为 jsbundle。 还更改了模式以在发布模式下运行。 但是当我运行该应用程序并单击一个按钮时,整个应用程序都崩溃了。

我按照以下网址中的示例进行操作

https://medium.com/react-native-development/deploying-a-react-native-app-for-ios-pt-1-a79dfd15acb8

这是按钮单击的代码

moveToJoinScreen(){
    this.props.navigation.navigate('JoinNowScreen')
}

这是错误

2017-10-25 17:10:50.240 [error][tid:com.facebook.react.JavaScript] undefined is not an object (evaluating 'console.tron.log')

2017-10-25 17:10:50.264 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: undefined is not an object (evaluating 'console.tron.log')

2017-10-25 17:10:50.270 StudentCardApp[1101:710561] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: undefined is not an object (evaluating 'console.tron.log')', reason: 'Unhandled JS Exception: undefined is not an object (evaluating 'console.tro..., stack:

<unknown>@1222:448

navigate@722:256

value@779:867

onPress@779:1314

touchableHandlePress@575:1882

_performSideEffectsForTransition@488:8512

_receiveSignal@488:7295

touchableHandleResponderRelease@488:4739

Gt@435:21830

invokeGuardedCallback@435:22155

invokeGuardedCallbackAndCatchFirstError@435:22277

C@435:1870

y@435:2072

nn@435:22882

rn@435:22989

P@435:3019

processEventQueue@435:23832

G@435:5536

handleTopLevel@435:27383

<unknown>@435:28885

qn@435:28110

z@435:6018

perform@436:3484

batchedUpdates@436:18575

Ce@435:10516

Q@435:6049

K@435:6111

_receiveRootNodeIDEvent@435:28856

receiveTouches@435:29236

value@340:3107

<unknown>@340:840

value@340:2535

value@340:812

'

*** First throw call stack:

(0x2488f91b 0x2402ae17 0x2488f861 0x8d2c9 0x8817f 0x248944c4 0x247ba87d 0x247be2f7 0x8b1df 0xd19e9 0xd1839 0x53ab7f 0x545493 0x53dde1 0x546ecf 0x5467cf 0x245c1b29 0x245c1718)

libc++abi.dylib: terminating with uncaught exception of type NSException

它在调试模式下运行良好。 有人可以帮我解决这个问题。 提前致谢

似乎您正在使用Reactotron 问题是 Reactotron 在非 DEV 版本中不可用。 检查讨论的这个问题https://github.com/infinitered/reactotron/issues/433

我通过以下方式解决了问题:

  1. 使用 VS 代码
  2. 单击左上角的放大镜按钮,跨工作区搜索和替换,键入console.tron.log并替换为if (__DEV__) console.tron.log
  3. 文件>全部保存。
  4. 成功。

最终使用了这个插件

https://github.com/infinitered/babel-plugin-ignite-ignore-reactotron

这将移除 Reacrtotron。

在以下链接上有更多解释

https://github.com/infinitered/reactotron/issues/433

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM