react-native-date-picker: Crash Android with `IllegalArgumentException`
Describe the bug My some Android devices crash when render DatePicker
java.lang.IllegalArgumentException: Unterminated quote
at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:884)
at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:684)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:623)
at com.henninghall.date_picker.wheels.Wheel.<init>(Wheel.java:35)
at com.henninghall.date_picker.wheels.YearWheel.<init>(YearWheel.java:21)
at com.henninghall.date_picker.ui.Wheels.<init>(Wheels.java:50)
at com.henninghall.date_picker.ui.UIManager.<init>(UIManager.java:27)
at com.henninghall.date_picker.PickerView.<init>(PickerView.java:27)
at com.henninghall.date_picker.DatePickerManager.createViewInstance(DatePickerManager.java:40)
at com.henninghall.date_picker.DatePickerManager.createViewInstance(DatePickerManager.java:25)
at com.facebook.react.uimanager.ViewManager.createViewInstance(ViewManager.java:139)
at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:83)
at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:270)
at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:180)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:987)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:958)
at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1039)
at android.view.Choreographer.doCallbacks(Choreographer.java:847)
at android.view.Choreographer.doFrame(Choreographer.java:771)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1027)
at android.os.Handler.handleCallback(Handler.java:809)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7555)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:469)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:963)
Expected behavior Render DatePicker ok
To Reproduce Add example code that reproduces the behavior.
export default class App extends Component {
state = { tempDate: new Date() }
render = () =>
<DatePicker
mode={mode}
date={tempDate}
collapsable
minuteInterval={1}
minimumDate={minimumDate}
maximumDate={maximumDate}
locale="vi"
style={{ alignSelf: 'center' }}
onDateChange={this.onDateChange}
/>
}
Smartphone (please complete the following information):
- OS: [Android or iOS] Android (only)
- React Native version [e.g. 0.59.4]: 0.62.2
- react-native-date-picker version [e.g. 2.5.1]: 2.7.9
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (3 by maintainers)
I checked.
2.7.11solves this problem. Thank you, guys @draperunner @henninghallI quoted his comment only. LOL
Tks @truongduyng
Released a potential fix for this in version
2.7.11@truongduyng could you check if it solves this problem?I have also met this issue. It only happens on HUAWEI and OPPO android device. I guess they did something with date format
Hi, could you please include all variables in your example? mode, tempDate etc