henninghall / react-native-date-picker

React Native Date Picker is datetime picker for Android and iOS. It includes date, time and datetime picker modes. The datepicker is customizable and is supporting different languages. It's written with native code to achieve the best possible look, feel and performance.
MIT License
2.25k stars 346 forks source link

Crash in production only. "java.lang.IllegalArgumentException" #169

Closed wmonecke closed 4 years ago

wmonecke commented 4 years ago

Describe the bug It appears the bug is related to language translation:

java.lang.IllegalArgumentException
com.henninghall.date_picker.props.LocaleProp.getDefaultLocale

java.lang.IllegalArgumentException: 
  at org.apache.commons.lang3.LocaleUtils.parseLocale (LocaleUtils.java:158)
  at org.apache.commons.lang3.LocaleUtils.toLocale (LocaleUtils.java:126)
  at com.henninghall.date_picker.props.LocaleProp.getDefaultLocale (LocaleProp.java:21)
  at com.henninghall.date_picker.props.LocaleProp.<init> (LocaleProp.java:17)
  at com.henninghall.date_picker.State.<init> (State.java:26)
  at com.henninghall.date_picker.PickerView.<init> (PickerView.java:26)
  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.createViewInstanceWithProps (ViewManager.java:119)
  at com.facebook.react.uimanager.ViewManager.createViewWithProps (ViewManager.java:66)
  at com.facebook.react.uimanager.NativeViewHierarchyManager.createView (NativeViewHierarchyManager.java:259)
  at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute (UIViewOperationQueue.java:198)
  at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations (UIViewOperationQueue.java:1036)
  at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded (UIViewOperationQueue.java:1007)
  at com.facebook.react.uimanager.GuardedFrameCallback.doFrame (GuardedFrameCallback.java:29)
  at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame (ReactChoreographer.java:172)
  at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame (ChoreographerCompat.java:84)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:979)
  at android.view.Choreographer.doCallbacks (Choreographer.java:790)
  at android.view.Choreographer.doFrame (Choreographer.java:718)
  at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:967)
  at android.os.Handler.handleCallback (Handler.java:808)
  at android.os.Handler.dispatchMessage (Handler.java:101)
  at android.os.Looper.loop (Looper.java:166)
  at android.app.ActivityThread.main (ActivityThread.java:7529)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:245)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:921)

To Reproduce I can't reproduce this in dev. But it appears on some devices in production.

Smartphone (please complete the following information):

Any ideas of what might be causing it?

henninghall commented 4 years ago

Thanks for reporting this, I believe it is related to https://github.com/henninghall/react-native-date-picker/issues/170 and I have a clue what it's about. I'll look into it shortly!

henninghall commented 4 years ago

Release a fix for this in v.2.7.8