React-native-picker-select: Error while updating property 'items' of a view managed by: AndroidDialogPicker

Created on 25 Feb 2020  路  7Comments  路  Source: lawnstarter/react-native-picker-select

Describe the bug

Getting an error that crashes the app

Error while updating property 'items' of a view managed by: AndroidDialogPicker

null

label

To Reproduce

Steps to reproduce the behavior:

  1. use React Native Picker Select on android?

Expected behavior

It works on iOS but not Android

Most helpful comment

I had the same error. My problem was that I was passing a string to the placeholder property. In iOS it just throws a warning so I ignored it, but turns out in Android it crashes the app.

All 7 comments

I'm experiencing this issue too, please what solution did you come up with ?
@lfkwtz

I didn鈥檛 - this isn鈥檛 a complete bug report

I had the same error. I was building the list of options dynamically and after debugging realized that on one case one item was missing the 'label' element. This caused the same error. All picker items should always have 'label' and 'value' elements.

I had the same error. My problem was that I was passing a string to the placeholder property. In iOS it just throws a warning so I ignored it, but turns out in Android it crashes the app.

@tomthornton Probably your items are incomplete (no label or no Id) or undefined, try to initialize your items with an array, solve the problem, at least here it worked.

Error:

<RNPickerSelect
            onValueChange={(value) => console.log(value)}
            items={null || undefined}
        />

Works:

<RNPickerSelect
            onValueChange={(value) => console.log(value)}
            items={[]}
        />

And yes the error only happens on android.
Why? I don't know.

I had the same error. My problem was that I was passing a string to the placeholder property. In iOS it just throws a warning so I ignored it, but turns out in Android it crashes the app.

You're a lifesaver! That's such a weird error.

I had the same error. My problem was that I was passing a string to the placeholder property. In iOS it just throws a warning so I ignored it, but turns out in Android it crashes the app.

Thanks a lot for the reply! Saved a lot of time!

Was this page helpful?
0 / 5 - 0 ratings