NativeScript / NativeScript/NativeScript

Rendering List View occasionally crashes in iOS == Assertion failed ==

Open
#9,117 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
25.7k
Forks
1.7k
Avg merge
1d 5h
Merged PRs (30d)
35

Description

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 7.0.12
  • Cross-platform modules: 7.0.13 (nativescript/core)
  • Android Runtime: 7.0.1
  • iOS Runtime: 7.0.6
  • XCode Version: 12.3
  • Plugin(s): @nativescript/camera 5.0.2, @nativescript/imagepicker 1.0.0, @nativescript/theme 3.0.1, @nstudio/nativescript-cardview 2.0.1, @nstudio/nativescript-pulltorefresh 3.0.1, @nativescript/barcodescanner 4.0.1

Describe the bug

There is a runtime error in iOS when a user navigates back and forth between two pages at least one of which having a list view. Occasionally, when the user navigates back to a page that has a list view, the application crashes and throws the following error.

====== Assertion failed ======
Native stack trace:
1          0x108eca2af tns::Assert(bool, v8::Isolate*) + 119
2          0x108e2b259 tns::ArgConverter::Invoke(v8::Local<v8::Context>, objc_class*, v8::Local<v8::Object>, tns::V8Args&, tns::MethodMeta const*, bool) + 95
3          0x108e8be5a tns::MetadataBuilder::InvokeMethod(v8::Local<v8::Context>, tns::MethodMeta const*, v8::Local<v8::Object>, tns::V8Args&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool) + 76
4          0x108e8b773 tns::MetadataBuilder::MethodCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 219
5          0x10901713c v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 620
6          0x1090165ec v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 556
7          0x109015c73 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) + 259
8          0x1098aec19 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 57
9          0x109847c42 Builtins_InterpreterEntryTrampoline + 194
10         0x109847c42 Builtins_InterpreterEntryTrampoline + 194
11         0x109847c42 Builtins_InterpreterEntryTrampoline + 194
12         0x109847c42 Builtins_InterpreterEntryTrampoline + 194
13         0x109847c42 Builtins_InterpreterEntryTrampoline + 194
14         0x109847c42 Builtins_InterpreterEntryTrampoline + 194
JavaScript stack trace:
at requestLayout (file: node_modules/@nativescript/core/ui/core/view/index.ios.js:37:0)
at <anonymous> (file: node_modules/@nativescript/core/ui/core/properties/index.js:895:0)
at clearInheritedProperties (file: node_modules/@nativescript/core/ui/core/properties/index.js:1144:0)
at _parentChanged (file: node_modules/@nativescript/core/ui/core/view-base/index.js:683:36)
at _removeView (file: node_modules/@nativescript/core/ui/core/view-base/index.js:463:0)
at _removeContainer (file: node_modules/@nativescript/core/ui/list-view/index.ios.js:412:0)
at push.../node_modules/@nativescript/core/ui/list-view/index.js.ListViewCell.willMoveToSuperview (file: node_modules/@nativescript/core/ui/list-view/index.ios.js:39:0)
at match (file: node_modules/@nativescript/core/ui/styling/css-selector/index.js:392:0)
at <anonymous> (file: node_modules/@nativescript/core/ui/styling/css-selector/index.js:376:0)
at match (file: node_modules/@nativescript/core/ui/styling/css-selector/index.js:376:0)

To Reproduce

  1. Open an app that has two pages one of which containing a list view.
  2. Navigate back and forth between the two pages.
  3. Observe when the app crashes once navigated to list view (occasionally).
  4. Read the error in the terminal.

Expected behavior
The application does not crash. At least, it displays a warning.

Sample project

Unfortunately none yet, but I will create a sample project that has this bug if needed.

Additional context

Already asked a question on Stack Overflow a while back.
https://stackoverflow.com/questions/65450002/nativescript-7-app-unexpectedly-crashes-in-ios-assertion-failed

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 navigation sequence and inspect requestLayout in node_modules/@nativescript/core/ui/core/view/index.ios.js alongside _removeContainer and willMoveToSuperview in ui/list-view/index.ios.js. Use the provided assertion and JavaScript stack trace to trace the failing transition; done means repeated navigation no longer crashes, or the issue produces the expected warning.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.