React-native-modal-datetime-picker: [Android] - TimePicker instant crashing app

Created on 13 Aug 2018  路  8Comments  路  Source: mmazzarolo/react-native-modal-datetime-picker

My application crashes as soon as I open TimePicker(only on android, iOS works fine).
Before everything works fine, but some day just start crashing.
I tried already TimePickerAndroid original from react-native and it's work, there is no app crashing.
Please help!!!

My code is:

<DateTimePicker mode="datetime" datePickerModeAndroid={"time"} isVisible={true} onConfirm={this._handleDatePicked} onCancel={this._hideDatePicker} />

Environment:
OS: macOS High Sierra 10.13.6
Node: 10.1.0
Yarn: Not Found
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.4.1 Build version 9F2000
Android Studio: 3.1 AI-173.4819257

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4

Repo version(I already tried last version, did not help)
"react-native-modal-datetime-picker": "^5.1.0",

Thanks in advance,
kind regards.

invalid

All 8 comments

Hi @franj0 ,
I'm sorry but we need more details about the crash, do you have any log about it?

Also please try using the example that you can find in the example dir of the app and see if it works correctly for you.

hi @mmazzarolo,

that it's point, I don't have any logs in debug mode in console. App just crash instantly when TimePicker need to be rendered.

I have only logcat from Android Studio and there is some log, but I don't get it.
Tomorrow I'll try example from repo but today I don't have time.

logcat catched error

screen shot 2018-08-13 at 7 53 17 pm

@franj0 your datePickerModeAndroid prop is invalid, the available values are: calendar or spinner.

See the readme and/or the RN docs for more info 馃憤

Let me know if it fixes your issue.

@mmazzarolo sorry, i write manually issue instead of copy paste and make mistake.
This is my code. If it spinner it's work normaly, but for calendar when i press OK for selected date and TimePicker need to be shown, application is crashed.

image

And logcat error seems same as one above

image

@franj could you try removing the datePickerModeAndroid prop?

@mmazzarolo thank you, it's working now, you can close this :)

Hi,

I ran into the same issue when specifying datePickerModeAndroid="calendar", thinking it was the default value. It crashes the app as soon as I change the date.

Turns out the default value is not "calendar" as specified in the read me but "default"
https://github.com/mmazzarolo/react-native-modal-datetime-picker/blob/6932b8579334b0a5a3bfeaee6366a2e29f15d831/src/CustomDatePickerAndroid/index.js#L22

Anyway, the fix is easy: use the actual default value by omitting the datePickerModeAndroid prop but I think this is still a bug :)

Thank you @arthur31416 , I guess it's just a leftover of an old API change

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ketanpatel3377 picture ketanpatel3377  路  5Comments

domsterthebot picture domsterthebot  路  3Comments

onusgit picture onusgit  路  7Comments

crobinson42 picture crobinson42  路  6Comments

akug17 picture akug17  路  3Comments