Nativescript: [Angular] ListPicker throws an error when [page.color] css property is set

Created on 10 Feb 2017  路  6Comments  路  Source: NativeScript/NativeScript

This is happening on:

  • Android.
  • CLI 2.50.
  • Cross-platform modules 2.5.0
  • tns-android 2.5.0

I create a new app by using the cli:

tns create app1 --ng

Then go to the app.css file and add this:

.page {
  color: #222;
}

Next, add a ListPicker into the item-detail.component.ts (I'm using the default template the cli provides).

Execute tns run android and get the example's list. Finally, click over a row and you will get the error:

image

bug done android

Most helpful comment

Fixed with versions 3.0.0.
The fix is currently released with the release candidate 3.0.0-rc.1

All 6 comments

@robertohuertasm
Thank you for reporting this one - I am confirming hat the issue is reproducible with an Angular application, NativeScript 2.5.0 on Android emulator and device.

Sample app to reproduce here (or use the steps provided by @robertohuertasm )

I have the same issue with an app not using Angular. Just adding a <ListPicker .../> to my XML will make the app crash when that screen is loaded.

I'm using:
NativeScript 2.5.2
tns-code-modules: 2.5.1
tns-android: 2.5.0

image

(the same line for ListPicker is mentioned)
image

I experience the same bug, when upgrading to the newest Nativescript 2.5.2 (also: tns-core-modules 2.5.2) on Android.

I call the firebase service (https://github.com/EddyVerbruggen/nativescript-plugin-firebase) to fill the ListPicker-Array in the constructor of the component. No problem in the previous tns-core-modules 2.4.3 but now getting the same errors, as posted above.

But: I could fix the problem with *ngIf.
Instead of showing the ListPicker directly onInit, I interposed a button. After I click the button, <ListPicker *ngIf gets triggered, and everything works fine...

Maybe the ListPicker tries to initialize too early?

Downgrading to 2.4.3 seems to be the only solution for now... Waiting for 3.0 to be released!

Fixed with versions 3.0.0.
The fix is currently released with the release candidate 3.0.0-rc.1

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

Related issues

minjunlan picture minjunlan  路  3Comments

NordlingDev picture NordlingDev  路  3Comments

Pourya8366 picture Pourya8366  路  3Comments

yclau picture yclau  路  3Comments

guillaume-roy picture guillaume-roy  路  3Comments