NativeScript / NativeScript/nativescript-cli

App hangs on unhandled exception when launched with `tns run`

未关闭
#3,177 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug os: ios run
主要语言
JavaScript
星标
1.1k
派生
204
平均合并
1 天 9 小时
30 天内合并 PR
8

描述

Please, provide the details below:

When you run a {N} application on a device using tns run and an unhandled ObjectiveC exception is raised, then the UI on the device freezes and the application doesn't terminate.

Did you verify this is a real problem by searching Stack Overflow and the other open issues in this repo?

Yes.

Tell us about the problem

The issue seems to be related to the way the application is started by the CLI. It uses lldb to launch and debug it on the device. Whenever an unhandled exception is detected by the debugger it breaks execution and awaits for commands on stdin. The CLI however doesn't send anything and the app appears as if it has hung.

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:
  • CLI: 3.2.1
  • Cross-platform modules: 3.2.0
  • Runtime(s): 3.2.0
Please tell us how to recreate the issue in as much detail as possible.

Launch an application which causes an unhandled ObjectiveC exception using tns run ios.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

Put this line of JS code in your application (e.g. on some button's click event):

new NSString().characterAtIndex(10);

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,使用提供的异常 new NSString().characterAtIndex(10); 通过 tns run ios 重现该问题,然后跟踪 CLI 如何通过 lldb 启动 iOS 应用程序。完成的标准是,未处理的 Objective-C 异常不再使设备 UI 保持冻结,并且应用程序终止,或 CLI 适当地处理调试器状态。

由索引模型根据 Issue 内容生成。

评估

技术栈
ios, javascript
领域
cli, mobile-dev
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。