NativeScript / NativeScript/nativescript-cli

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

Open
#3,177 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug os: ios run
Dominant language
JavaScript
Stars
1.1k
Forks
204
Avg merge
1d 9h
Merged PRs (30d)
8

Description

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);

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with tns run ios using the provided new NSString().characterAtIndex(10); exception, then trace how the CLI launches the iOS application through lldb. Done means an unhandled Objective-C exception no longer leaves the device UI frozen and the application terminates or the CLI handles the debugger state appropriately.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript
Domain
cli, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.