简体   繁体   English

系统 iOS 更新后 React Native 应用程序在启动时崩溃

[英]React Native app crashing on start after system iOS update

I ran into this issue a while ago: I install my app in my iPhone both in debug and release and it works well.我刚才遇到了这个问题:我在我的iPhone中安装了我的应用程序,在调试和发布时都运行良好。 However after some time (days, weeks) it starts crashing for no apparent reason on start, right after the splash screen shows up.然而,一段时间后(几天,几周)它开始无缘无故地开始崩溃,就在启动画面出现之后。 I suspect this happens after every iOS update.我怀疑每次 iOS 更新后都会发生这种情况。

At first I thought this had something to do with the metro bundler not running but the app crashes both in debug and release.起初我认为这与未运行的 metro bundler 有关,但应用程序在调试和发布时都崩溃了。

I'm really just everything as described in the docs.我真的只是文档中描述的一切。 The main problem here is a can't reproduce this error (or at least I don't know how) since it depends on an iOS update so I can't do it on the simulator, only in a real device.这里的主要问题是无法重现此错误(或者至少我不知道如何重现),因为它取决于 iOS 更新,所以我不能在模拟器上重现,只能在真实设备上重现。

EDIT: I got some logs from the crash, thanks to this buddybuild guide .编辑:多亏了这个 buddybuild guide ,我从崩溃中得到了一些日志。

The logs for Release:发布日志:

error 09:30:50.134080 +0200 assertiond Unable to obtain a task name port right for pid 19786: (os/kern) failure (0x5)错误 09:30:50.134080 +0200 assertiond 无法获取 pid 19786 的任务名称端口权:(os/kern) 失败 (0x5)

error 09:30:50.134299 +0200 assertiond Failed to start job with error { description = "Unable to get valid task name port right for pid 19786";错误 09:30:50.134299 +0200 assertiond 无法启动作业,错误 { description = "无法获得 pid 19786 的有效任务名称端口权"; failureReason = "The process failed to exec"; failureReason = "进程执行失败"; recoverySuggestion = "Consult /var/log/com.apple.xpc.launchd/launchd.log for more information"; recoverySuggestion = "查阅 /var/log/com.apple.xpc.launchd/launchd.log 了解更多信息"; } }

error 09:30:50.137082 +0200 SpringBoard [org.josemigallas.RealmsCounter] Bootstrap failed with error:错误 09:30:50.137082 +0200 SpringBoard [org.josemigallas.RealmsCounter] Bootstrap 失败,出现错误:

error 09:30:50.137354 +0200 SpringBoard Bootstrapping failed for with error: Error Domain=BKSProcessErrorDomain Code=1 "Unable to bootstrap process with bundleID org.josemigallas.RealmsCounter" UserInfo {NSLocalizedDescription=Unable to bootstrap process with bundleID org.josemigallas.RealmsCounter, BKSProcessExitReason=0, NSLocalizedFailureReason=Failed to start job, NSUnderlyingError=0x282693900 {Error Domain=NSPOSIXErrorDomain Code=3 "No such process" UserInfo={NSLocalizedFailureReason=The process failed to exec, NSLocalizedRecoverySuggestion=Consult /var/log/com.apple.xpc.launch /launchd.log for more information, NSLocalizedDescription=Unable to get valid task name port right for pid 19786}}, BSErrorCodeDescription=bootstrap-failed}错误 09:30:50.137354 +0200 SpringBoard Bootstrapping 因错误而失败:错误域=BKSProcessErrorDomain 代码=1“无法使用 bundleID org.josemigallas.RealmsCounter 引导进程”UserInfo {NSLocalizedDescription=无法使用 bundleID org.josemigallas.RealmsCounter 引导进程, BKSProcessExitReason=0, NSLocalizedFailureReason=启动作业失败, NSUnderlyingError=0x282693900 {Error Domain=NSPOSIXErrorDomain Code=3 "No such process" UserInfo={NSLocalizedFailureReason=进程执行失败, NSLocalizedRecoverySuggestion=Consult /var/log/com.apple .xpc.launch /launchd.log 获取更多信息,NSLocalizedDescription=无法获得 pid 19786 的有效任务名称端口权}},BSErrorCodeDescription=bootstrap-failed}

EDIT2: I found out it's happening in debug as well.. so updating the text a bit. EDIT2:我发现它也在调试中发生......所以稍微更新一下文本。

Thanks in advance.提前致谢。

Turned out it wasn't the updates.. but the Provisioning Profile that expires after 6 days, the application has to be rebuild and installed everytime.原来不是更新..而是配置文件在 6 天后过期,应用程序每次都必须重建和安装。 This happens with a free Apple developer account.使用免费的 Apple 开发者帐户会发生这种情况。

If this is crashing in a released app, you might be able to find the crash logs by going to Xcode->Window->Organizer and select the Crashes tab at the top.如果这是在已发布的应用程序中崩溃,您可以通过转到Xcode->Window->Organizer并选择顶部的 Crashes 选项卡来找到崩溃日志。

If I were to guess, it sounds like it's taking too long for initialization, and so it's getting killed by the springboard app.如果我猜的话,这听起来像是初始化花费的时间太长,所以它被 springboard 应用程序杀死了。

As far as I know there isn't a way to debug an app which is in release mode via Xcode . 据我所知,还没有办法通过Xcode调试处于发布模式的应用程序。 But what you could do is use a tool that has really helped me in debugging my production releases: Bugsnag . 但是您可以做的是使用一个确实能帮助我调试生产版本的工具: Bugsnag

It's really quick and easy to setup, and fully supports React Native. 它的设置非常简单快捷,并且完全支持React Native。 It will give you the full errors wherever the app is used. 无论您在哪里使用该应用程序,它都将给您完整的错误。

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

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