Nativescript: iOS crashes with SearchBar inside ActionBar on {N} 4

Created on 27 Apr 2018  路  5Comments  路  Source: NativeScript/NativeScript

Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?

Yes

Tell us about the problem

SearchBar component inside an ActionBar crashes the app. This used to work fine on {N} 3.x.
Stack is:

2018-04-27 09:31:09.609 nsplaydev[816:519255] *** Assertion failure in -[UISearchBar sizeThatFits:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3698.52.10/UISearchBar.m:1678
2018-04-27 09:31:09.614 nsplaydev[816:519255] PlayLiveSync: Uncaught Exception
2018-04-27 09:31:09.614 nsplaydev[816:519255] PlayLiveSync: Sending crash report
2018-04-27 09:31:13.617 nsplaydev[816:519255] *** JavaScript call stack:
(
0 sizeThatFits@[native code]
1 measureNativeView@file:///app/tns_modules/tns-core-modules/utils/utils.js:34:43
2 onMeasure@file:///app/tns_modules/tns-core-modules/ui/core/view/view.js:92:68
3 measure@file:///app/tns_modules/tns-core-modules/ui/core/view/view.js:50:27
4 measureChild@file:///app/tns_modules/tns-core-modules/ui/core/view/view-common.js:802:26
5 onMeasure@file:///app/tns_modules/tns-core-modules/ui/action-bar/action-bar.js:279:50
6 measure@file:///app/tns_modules/tns-core-modules/ui/core/view/view.js:50:27
7 layoutInternal@file:///app/tns_modules/tns-core-modules/ui/action-bar/action-bar.js:122:21
8 update@file:///app/tns_modules/tns-core-modules/ui/action-bar/action-bar.js:178:32
9 onLoaded@file:///app/tns_modules/tns-core-modules/ui/page/page.js:201:34
10 @file:///app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js:311:98
11 callFunctionWithSuper@file:///app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js:304:13
12 callLoaded@file:///app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js:311:35
13 loadView@file:///app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js:439:28
14 _addViewCore@file:///app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js:434:26
15 _addView@file:///app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js:420:26
16 viewWillAppear@file:///app/tns_modules/tns-core-modules/ui/page/page.js:70:31
17 UIApplicationMain@[native code]
18 start@file:///app/tns_modules/tns-core-modules/application/application.js:264:26
19 bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:86:28
20 bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:72:26
21 anonymous@file:///app/main.js:8:57
22 evaluate@[native code]
23 moduleEvaluation@:1:11
24 @:7:48
25 promiseReactionJob@:1:11

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

  • CLI: 4.1.0-2018-04-18-11407
  • Cross-platform modules: 4.0.0
  • Runtime(s): 4.0.1
  • Plugin(s): (look for the version number in the package.json file of your
    project)

Please tell us how to recreate the issue in as much detail as possible.

Playground is available here:
https://play.nativescript.org/?template=play-ng&id=ayhcjE&v=2

ios

Most helpful comment

Hi @noumaans,
This issue has been fixed in @next modules. You can try adding next modules version by using the following steps:

  1. tns plugin remove tns-core-modules
  2. tns plugin add tns-core-modules
  3. tns platform remove ios
  4. tns platform add ios

All 5 comments

Hi @noumaans,
Thank you for the sample project.
I tested it on my side and was able to recreate the issue. Regarding that, I will mark this issue as a bug.
Regarding that, I would suggest keeping track on the issue for further info.

@tsonevn any chance this can be given priority since it is blocking migration of project to {N} 4?
I really appreciate your help. Thanks.

Hi @noumaans,
This issue has been fixed in @next modules. You can try adding next modules version by using the following steps:

  1. tns plugin remove tns-core-modules
  2. tns plugin add tns-core-modules
  3. tns platform remove ios
  4. tns platform add ios

Thank you so much for the quick fix. Please feel free to close this issue when convenient.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings