Nativescript: IOS Crashes randomly even after ios 7.0.2-rc1 #8937 fixes

Created on 12 Oct 2020  Â·  22Comments  Â·  Source: NativeScript/NativeScript

Crashing after resuming and sometimes when changing pages. Using nativescript-vue. Tried to resymbolicate the crash logs in vain.

core 7.0.9
ios 7.0.2-rc1

Attached crash logs in case anyone can make heads or tails of em.

Trying to revert back to core 7.0.0 and ios 7.0.0 as i have it confirmed working with another app.

attachment.crashlog-745C0769-A12D-448E-BF1B-74B9E99717EB.txt
attachment.crashlog-E731C3DE-C0CE-4BE8-912D-A76C69773E91.txt
attachment.crashlog-41FBBA8F-A6D7-4E5F-A406-6E34A79A45C7.txt

Most helpful comment

@gideon-io we did it by adding the pre-NS7 configuration-block into our package.json as well as replacing the runtimes:

package.json

{
    "nativescript": {
        "tns-ios": {
            "version": "6.5.3"
        }
    }

    ...

    "devDependencies": {
        ...
        "tns-ios": "6.5.3",
        ...
    }
}

Make sure to remove the v8 runtime that came with NS7 from the package.json (@nativescript/ios).
At least this is what worked for us. No crashes in our app since we made those changes.

I agree with you. This doesn't seem to be documented anywhere.

All 22 comments

@michael-dots did you try core 7.0.10 by chance?
There was an issue related to tree shaking that I'd be curious if is somehow related:
https://github.com/NativeScript/NativeScript/releases/tag/7.0.10-core

Also would be curious if you tried tns-ios 6.5.3 and if you encounter same thing or not. You can use that ios runtime with {N} core 7.0.10 and xcode 12 just fine.

@NathanWalker thanks for getting back to me. I'll try both.
I did check my app on 7.0.0 and realized it had the same issue, apple just didn't come across it during review i guess. I could make it crash easily by hammering the different menu buttons.
Also trying to reproduce in ios simulator to see if I get any kind of error. Could not reproduce on android.

On surface sounds like some v8 ios engine issue but for sure if you see it never happen on tns-ios 6.5.3 would answer that for sure.

Here is error in simulator on 7.0.0 / 7.0.0. Trying 7.0.10 / 7.0.2-rc1 next

====== Assertion failed ======
Native stack trace:
1 0x10d5beceb tns::Assert(bool, v8::Isolate) + 119
2 0x10d52e079 tns::ArgConverter::Invoke(v8::Local, objc_class
, v8::Local, tns::V8Args&, tns::MethodMeta const, bool) + 95
3 0x10d58683a tns::MetadataBuilder::InvokeMethod(v8::Local, tns::MethodMeta const
, v8::Local, tns::V8Args&, std::__1::basic_string, std::__1::allocator >, bool) + 76
4 0x10d586111 tns::MetadataBuilder::MethodCallback(v8::FunctionCallbackInfo const&) + 219
5 0x10d6f622c v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 620
6 0x10d6f56dc v8::internal::MaybeHandle v8::internal::(anonymous namespace)::HandleApiCallHelper(v8::internal::Isolate, v8::internal::Handle, v8::internal::Handle, v8::internal::Handle, v8::internal::Handle, v8::internal::BuiltinArguments) + 556
7 0x10d6f4d63 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate
) + 259
8 0x10df8dd19 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 57
JavaScript stack trace:
at requestLayout (file: app/packages/core/ui/core/view/index.ios.ts:63:14)
at (file: app/packages/core/ui/core/properties/index.ts:1129:11)
at (file: app/packages/core/ui/core/properties/index.ts:1137:23)
at eachChildView (file: app/packages/core/ui/layouts/layout-base-common.ts:125:18)
at eachChild (file: app/packages/core/ui/core/view/view-common.ts:867:7)
at (file: app/packages/core/ui/core/properties/index.ts:1132:10)
at clearInheritedProperties (file: app/packages/core/ui/core/properties/index.ts:1433:26)
at _parentChanged (file: app/packages/core/ui/core/view-base/index.ts:980:28)
at _removeView (file: app/packages/core/ui/core/view-base/index.ts:708:7)
at _removeContainer (file: app/packages/core/ui/list-view/index.ios.ts:496:14)

Crashed on 7.0.2-rc1. Could NOT make it crash on 6.5.3.

Ok great to know thanks for confirming. From your stack it seems to rise from requestLayout in core and then reveals v8 engine stack - could you share your package when get a chance? Would be curious if using any particular UI plugins which may reveal a source.

I assume you mean package.json?

"dependencies": {
"@nativescript/core": "~7.0.0",
"@nativescript/firebase": "^11.0.0",
"@nstudio/nativescript-loading-indicator": "^4.0.0",
"@nstudio/nativescript-pulltorefresh": "^1.1.1",
"lodash": "^4.17.20",
"moment": "^2.28.0",
"nativescript-facebook": "^4.2.1",
"nativescript-social-share": "^1.6.0",
"nativescript-theme-core": "^2.0.24",
"nativescript-urlhandler": "^1.3.0",
"nativescript-vue": "^2.8.1",
"tslib": "^1.13.0",
"vue-property-decorator": "^8.5.1"
},
"devDependencies": {
"@babel/core": "~7.1.0",
"@babel/preset-env": "~7.1.0",
"@nativescript/android": "7.0.0",
"@nativescript/ios": "7.0.0",
"@nativescript/types": "7.0.0",
"@nativescript/webpack": "~3.0.0",
"@types/lodash": "^4.14.123",
"babel-loader": "~8.0.0",
"nativescript-vue-template-compiler": "2.3.0",
"node-sass": "4.12.0",
"typescript": "^3.4.1",
"vue": "^2.6.10",
"vue-class-component": "^7.0.2",
"vue-loader": "~15.4.0"
},

@nstudio/nativescript-loading-indicator is being used during ajax request on pages that causes crash. Don't know if that could be the culprit though.

async mounted() {
    spinner.during(userService.getCompanyScores().then((groups) => {
        this.groups = groups;
        this.activeGroup = this.groups[0];
    }), "Loading...");
}

"spinner" is a class that takes care of opening/closing the loading indicator during an operation.

Hi,

Getting the same error in crash logs for a recent build we released to some users. The below crash occurred using the simulator.

===

====== Assertion failed ======
Native stack trace:
1 0x11277cceb tns::Assert(bool, v8::Isolate) + 119
2 0x1126ec079 tns::ArgConverter::Invoke(v8::Local, objc_class
, v8::Local, tns::V8Args&, tns::MethodMeta const, bool) + 95
3 0x11274483a tns::MetadataBuilder::InvokeMethod(v8::Local, tns::MethodMeta const
, v8::Local, tns::V8Args&, std::__1::basic_string, std::__1::allocator >, bool) + 76
4 0x112744111 tns::MetadataBuilder::MethodCallback(v8::FunctionCallbackInfo const&) + 219
5 0x1128b422c v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 620
6 0x1128b36dc v8::internal::MaybeHandle v8::internal::(anonymous namespace)::HandleApiCallHelper(v8::internal::Isolate, v8::internal::Handle, v8::internal::Handle, v8::internal::Handle, v8::internal::Handle, v8::internal::BuiltinArguments) + 556
7 0x1128b2d63 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate
) + 259
8 0x11314bd19 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 57
9 0x1130e4d42 Builtins_InterpreterEntryTrampoline + 194
JavaScript stack trace:
at _removeViewFromNativeVisualTree (file: app/packages/core/ui/core/view/index.ios.ts:787:29)
at _tearDownUI (file: app/packages/core/ui/core/view-base/index.ts:871:15)
at (file: app/packages/core/ui/core/view-base/index.ts:865:9)
at eachChildView (file: app/packages/core/ui/layouts/layout-base-common.ts:125:18)
at eachChild (file: app/packages/core/ui/core/view/view-common.ts:867:7)
at _tearDownUI (file: app/packages/core/ui/core/view-base/index.ts:864:7)
at _removeViewCore (file: app/packages/core/ui/core/view-base/index.ts:718:8)
at _removeView (file: app/packages/core/ui/core/view-base/index.ts:706:7)
at _removeContainer (file: app/packages/core/ui/list-view/index.ios.ts:496:14)
at ListViewCell.willMoveToSuperview (file:///app/vendor.js:38350:14)

===

package.json

"dependencies": {
    "@nativescript-community/drawingpad": "^4.0.0",
    "@nativescript/camera": "^5.0.0",
    "@nativescript/core": "^7.0.11",
    "@nativescript/datetimepicker": "^2.0.3",
    "@nativescript/firebase": "^11.0.0",
    "@nativescript/imagepicker": "^1.0.0",
    "@nativescript/theme": "^3.0.0",
    "@nativescript/webpack": "3.0.0",
    "@nstudio/nativescript-pulltorefresh": "^3.0.1",
    "@vue/devtools": "^5.1.0",
    "deepmerge": "^4.0.0",
    "lodash": "^4.17.11",
    "moment": "^2.24.0",
    "nativescript-bitmap-factory": "^1.8.1",
    "nativescript-directions": "^1.3.0",
    "nativescript-fonticon": "^2.0.0",
    "nativescript-geolocation": "5.1.0",
    "nativescript-socketio": "^3.3.1",
    "nativescript-sqlite": "^2.3.3",
    "nativescript-toasty-ns-7": "^14.0.0",
    "nativescript-ui-sidedrawer": "^9.0.3",
    "nativescript-vue": "^2.8.1",
    "nativescript-vue-devtools": "^1.4.0",
    "nativescript-vue-template-compiler": "^2.8.1",
    "vue-loader": "^15.7.0",
    "vue-moment": "^4.0.0",
    "vuex": "^3.1.0"
  },
  "devDependencies": {
    "@babel/core": "^7.0.0",
    "@babel/preset-env": "^7.0.0",
    "@nativescript/android": "7.0.0",
    "@nativescript/ios": "7.0.0",
    "babel-loader": "^8.0.2",
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "lazy": "1.0.11",
    "node-sass": "^4.9.2",
    "vue-loader": "^15.2.6"
  },

+1 I'm in the same team as Gideon above. This error is seriously hampering our app and customers.

@devlinpadayachee - Can you also post your package.json, and tns info and xcode version...

@devlinpadayachee - Can you also post your package.json, and tns info and xcode version...

Hi @NathanaelA , thank you for getting back to us. I'm in the same Team as @gideon-io above. so the details will be the same as that post.

Can you duplicate this easily? Or is this very random?
Have you tried using the 6.5.3 engine to see if this is limited to the new V8 engine?

Cant duplicate it easily. It happens seemingly at random, but seems to happen when we either navigate back to a previous screen, or close a modal or something along the lines of redrawing a screen. I'm guessing the at _removeViewFromNativeVisualTree is consistent with what we are experiencing. It only occurs on IOS. Android seems to work perfectly. No errors in 6.5.3

I would add a console log in iOS requestLayout function where it crashes (look at the stack to find the file but it will be a js file!). In that log I would print the class name of the current object (this.constructor. name).
This could help a lot in understanding if it comes from a plugin or not. I might have an idea of what is happening

I would add a console log in iOS requestLayout function where it crashes (look at the stack to find the file but it will be a js file!). In that log I would print the class name of the current object (this.constructor. name).
This could help a lot in understanding if it comes from a plugin or not. I might have an idea of what is happening

Ok Cool @gideon-io and I will try that.

@NathanaelA

Can you duplicate this easily? Or is this very random?
Have you tried using the 6.5.3 engine to see if this is limited to the new V8 engine?

We are testing tns-ios 6.5.3 currently to see if the issue occurs there.

Regarding your previous question: Xcode Version 12.0.1 (12A7300).

Here are the results for tns info prior to reverting to tns-ios 6.5.3:

✔ Getting NativeScript components versions information...
✔ Component nativescript has 7.0.10 version and is up to date.
✔ Component @nativescript/core has 7.0.11 version and is up to date.
âš  Update available for component @nativescript/ios. Your current version is 7.0.0 and the latest available version is 7.0.2-rc1.
✔ Component @nativescript/android has 7.0.0 version and is up to date.

We are also experiencing this issue in one of our projects after upgrading to NativeScript 7.0.
The App randomly crashes on Hardware (iPhone XS (iOS 14) and iPhone X (iOS 13) as well as the iOS Simulator (iOS 14).
This error only occures on NS 7+ for us. The App worked fine on 6.5.3.

Occured on
iPhone XS - iOS 14
iPhone X - iOS 13
iOS Simulator - 14.0

Xcode
Version: 12.0.1

NativeScript
✔ Getting NativeScript components versions information...
✔ Component nativescript has 7.0.10 version and is up to date.
✔ Component @nativescript/core has 7.0.11 version and is up to date.
âš  Update available for component @nativescript/ios. Your current version is 7.0.1 and the latest available version is 7.0.2-rc1.
✔ Component @nativescript/android has 7.0.0 version and is up to date.

Error logs from Xcode

2020-10-16 11:44:14.240630+0200 appname[52237:387025] ====== Assertion failed ======
2020-10-16 11:44:14.240744+0200 appname[52237:387025] Native stack trace:
2020-10-16 11:44:14.244619+0200 appname[52237:387025] 1          0x106669939 tns::Assert(bool, v8::Isolate*) + 119
2020-10-16 11:44:14.245223+0200 appname[52237:387025] 2          0x1065cb649 tns::ArgConverter::Invoke(v8::Local<v8::Context>, objc_class*, v8::Local<v8::Object>, tns::V8Args&, tns::MethodMeta const*, bool) + 95
2020-10-16 11:44:14.245657+0200 appname[52237:387025] 3          0x10662bafe 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
2020-10-16 11:44:14.245914+0200 appname[52237:387025] 4          0x10662b377 tns::MetadataBuilder::MethodCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 219
2020-10-16 11:44:14.246100+0200 appname[52237:387025] 5          0x1067b653c v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 620
2020-10-16 11:44:14.246329+0200 appname[52237:387025] 6          0x1067b59ec 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
2020-10-16 11:44:14.246506+0200 appname[52237:387025] 7          0x1067b5073 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) + 259
2020-10-16 11:44:14.246670+0200 appname[52237:387025] 8          0x10704e019 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 57
2020-10-16 11:44:14.246768+0200 appname[52237:387025] JavaScript stack trace:
2020-10-16 11:44:14.247489+0200 appname[52237:387025] at _removeViewFromNativeVisualTree (file:///app/vendor.js:120187:39)
at _tearDownUI (file:///app/vendor.js:119159:25)
at <anonymous> (file:///app/vendor.js:119155:19)
at eachChildView (file:///app/vendor.js:130058:28)
at eachChild (file:///app/vendor.js:120927:14)
at _tearDownUI (file:///app/vendor.js:119154:14)
at _removeViewCore (file:///app/vendor.js:119062:18)
at _removeView (file:///app/vendor.js:119052:14)
at _removeContainer (file:///app/vendor.js:213700:22)
at push.../node_modules/nativescript-ui-listview/ui-listview.js.ExtendedListViewCell.willMoveToSuperview (file:///app/vendor.js:213433:20)
Assertion failed: (false), function Assert, file /Users/rigor789/Code/v8ios/ns-v8ios-runtime/NativeScript/runtime/Helpers.mm, line 651.
Assertion failed: (false), function Assert, file /Users/rigor789/Code/v8ios/ns-v8ios-runtime/NativeScript/runtime/Helpers.mm, line 651.
CoreSimulator 732.17 - Device: iPhone 11 Pro (60EFA00B-2824-4B91-A349-0EAC5B809436) - Runtime: iOS 14.0 (18A372) - DeviceType: iPhone 11 Pro

@NathanWalker @NathanaelA it's unclear how to use the 6.5.3 runtime to build the app. Do I just need to install the package and then add this to my package.json ?

"nativescript": { "id": "com.company.app", "tns-ios": { "version": "6.5.3" } },

How can I confirm the app is definitely being built with the older runtime?

@gideon-io we did it by adding the pre-NS7 configuration-block into our package.json as well as replacing the runtimes:

package.json

{
    "nativescript": {
        "tns-ios": {
            "version": "6.5.3"
        }
    }

    ...

    "devDependencies": {
        ...
        "tns-ios": "6.5.3",
        ...
    }
}

Make sure to remove the v8 runtime that came with NS7 from the package.json (@nativescript/ios).
At least this is what worked for us. No crashes in our app since we made those changes.

I agree with you. This doesn't seem to be documented anywhere.

We are facing a similar issue with the AppsFlyer plugin.

What are the perspectives of tns-ios 6.5.x vs 7.x.x?
Will you continue to maintain both or will we at some points blocked because we are not using the new v7 of the plugin?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Pourya8366 picture Pourya8366  Â·  3Comments

guillaume-roy picture guillaume-roy  Â·  3Comments

Leo-lay picture Leo-lay  Â·  3Comments

NickIliev picture NickIliev  Â·  3Comments

dhanalakshmitawwa picture dhanalakshmitawwa  Â·  3Comments