technologic12
technologic12

Reputation: 29

Nativescript - ActionBar error

Good day,

I'm creating an iOS app using Nativescript. I tried to add a title to the ActionBar in iOS but it kept failing. I have since removed the ActionBar tags and any traces from my code but my app won't launch and it keeps giving me the following output and crashes:

Jul 15 13:17:41 Shivas-Air cngMobileApp[18451]: 1   0x4840b0 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
Jul 15 13:17:41 Shivas-Air cngMobileApp[18451]: 2   0xb316f8 ffi_closure_inner
Jul 15 13:17:41 Shivas-Air cngMobileApp[18451]: 3   0xb32022 ffi_closure_i386
Jul 15 13:17:41 Shivas-Air cngMobileApp[18451]: 4   0x1704ceb -[UIViewController __viewWillAppear:]
Jul 15 13:17:41 Shivas-Air cngMobileApp[18451]: 5   0x1706789 -[UIViewController viewWillMoveToWindow:]
Jul 15 13:17:41 Shivas-Air cngMobileApp[18451]: 6   0x15e98bb -[UIView(Hierarchy) _willMoveToWindow:withAncestorView:]
Jul 15 13:17:41 Shivas-Air cngMobileApp[18451]: 7   0x15fa0f8 -[UIView(Internal) _addSubview:positioned:relativeTo:]
Jul 15 13:17:41 Shivas-Air cngMobileApp[18451]: 8   0x15e8cc8 -[UIView(Hierarchy) addSubview:]
Jul 15 13:17:41 Shivas-Air cngMobileApp[18451]: 9   0xb31ee8 ffi_call_i386
Jul 15 13:17:41 Shivas-Air cngMobileApp[18451]: **file:///app/tns_modules/ui/page/page.js:314:35: JS ERROR TypeError: frame._updateActionBar is not a function. (In 'frame._updateActionBar(this)', 'frame._updateActionBar' is undefined)
Jul 15 13:17:41 Shivas-Air com.apple.CoreSimulator.SimDevice.20124C04-21CD-486F-9DFE-439512DD31BD.launchd_sim[18070]** (UIKitApplication:org.nativescript.cngMobileApp[0xc804][18451]): Service exited due to signal: Segmentation fault: 11

Please note the area in bold. I deleted my ios folder from the platforms folder and re-added the platform but that still hasn't resolved the issue. Any assistance is appreciated.

Upvotes: 0

Views: 479

Answers (2)

Bogdan
Bogdan

Reputation: 863

I had the same issue myself, while trying to use the DropDown third party plugin. The root cause of the problem is the misunderstanding from my side on how NativeScript and Angular2 work.

Basically, in my case, the DropDown documentation stated that the html code of the component must be put between <Page></Page> tags. But, by using Angular2, this tag is no needed, so generally the HTML code does not contain the <Page> tag.

All I needed to do is the following:

  • In main.ts: import { registerElement } from "nativescript-angular/element-registry";

  • Then, call: registerElement("DropDown", () => require("nativescript-drop-down/drop-down").DropDown);

The important thing to note here is that the first argument of the registerElement function is the tag itself, so in my case the tag used in HTML code is <DropDown></DropDown>.

Upvotes: 2

technologic12
technologic12

Reputation: 29

In my HTML files I have a tag and then a tag with respective closing tags. I removed the and tags from all the HTML files and my project successfully compiled and ran.

Upvotes: -1

Related Questions