React原生iOS应用 - 在发布模式下崩溃

时间:2017-10-25 04:15:34

标签: react-native release

我是新手,对本机做出反应并尝试进行发布版本。我已将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

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

3 个答案:

答案 0 :(得分:1)

好像你正在使用Reactotron。 事情是Reactotron在非DEV版本中不可用。 请查看此问题[{3}}

答案 1 :(得分:1)

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

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

答案 2 :(得分:0)

最终使用此插件

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

这删除了Reacrtotron。

以下链接的更多解释

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

相关问题