Nativescript 7 App unexpectedly crashes in ios == Assertion failed ==

Viewed 564

I am developing an app using Nativescript 7 and it keeps crashing unexpectedly in iOS. All versions of iOS crash (12, 13, and 14 so far).

Here is the stack trace:

====== Assertion failed ======
Native stack trace:
1          0x10ac972af tns::Assert(bool, v8::Isolate*) + 119
2          0x10abf8259 tns::ArgConverter::Invoke(v8::Local<v8::Context>, objc_class*, v8::Local<v8::Object>, tns::V8Args&, tns::MethodMeta const*, bool) + 95
3          0x10ac58e5a 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          0x10ac58773 tns::MetadataBuilder::MethodCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 219
5          0x10ade413c v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 620
6          0x10ade35ec 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          0x10ade2c73 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) + 259
8          0x10b67bc19 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 57
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 <anonymous> (file: node_modules/@nativescript/core/ui/core/properties/index.js:902:0)
at eachChildView (file: node_modules/@nativescript/core/ui/content-view/index.js:65:0)
at eachChild (file: node_modules/@nativescript/core/ui/core/view/view-common.js:700:0)
at <anonymous> (file: node_modules/@nativescript/core/ui/core/properties/index.js:897: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:411:0)

nativescript.config.ts

import { NativeScriptConfig } from '@nativescript/core';

export default {
  id: 'org.nativescript.sampleapp',
  appResourcesPath: 'App_Resources',
  android: {
    v8Flags: '--expose_gc',
    markingMode: 'none',
    discardUncaughtJsExceptions: true
  },
  ios: {
    discardUncaughtJsExceptions: true
  }
} as NativeScriptConfig;

package.json

{
  "name": "@nativescript/template-hello-world",
  "main": "app.js",
  "version": "7.0.1",
  "author": "NativeScript Team <oss@nativescript.org>",
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "publishConfig": {
    "access": "public"
  },
  "keywords": [
    "nstudio",
    "nativescript",
    "mobile",
    "{N}",
    "tns",
    "template"
  ],
  "repository": "<fill-your-repository-here>",
  "bugs": {
    "url": "https://github.com/NativeScript/NativeScript/issues"
  },
  "homepage": "https://github.com/NativeScript/nativescript-app-templates",
  "dependencies": {
    "@nativescript/camera": "^5.0.2",
    "@nativescript/core": "~7.0.13",
    "@nativescript/imagepicker": "^1.0.0",
    "@nativescript/theme": "^2.3.3",
    "@nstudio/nativescript-cardview": "^2.0.1",
    "@nstudio/nativescript-pulltorefresh": "^3.0.1",
    "nativescript": "^7.0.12",
    "nativescript-barcodescanner": "^4.0.1"
  },
  "devDependencies": {
    "@nativescript/android": "7.0.1",
    "@nativescript/ios": "7.0.6",
    "@nativescript/webpack": "~3.0.8"
  },
  "gitHead": "xyz",
  "private": "true",
  "readme": "NativeScript Application"
}

I am suspecting that the version of Nativescript is the reason behind this and if an update is available, the bug might have been fixed in v8. Thanks in advance.

2 Answers

Is it worth trying to do:

tns update next

I found a github issue for the v8 runtime for Nativescript mentioning the exact same issue. In order to follow it only in one place, please see the link.

It mentions the following:

  • When navigating back from a RadListView or a ScrollView, the application might unexpectedly crash because of a bug in ios's v8 engine.
  • Some people mentioned that they only faced this issue when the orientation of the list or scroll view is horizontal.
  • The team is still working towards making the application at least not crash when this problem occurs.
Related