beefe / react-native-picker

A Native Picker with high performance.
1.75k stars 786 forks source link

java.lang.ArrayIndexOutOfBoundsException: length=0; index=0 #350

Open wcngsb opened 5 years ago

wcngsb commented 5 years ago

java.lang.ArrayIndexOutOfBoundsException: length=0; index=0 at com.facebook.react.bridge.ReadableNativeArray.getType(ReadableNativeArray.java:164) at com.beefe.picker.PickerViewModule._init(PickerViewModule.java:306) at java.lang.reflect.Method.invoke(Method.java) at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372) at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160) at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29) at android.os.Looper.loop(Looper.java:148) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192) at java.lang.Thread.run(Thread.java:818)

This is error massage. Anyone have the same question? How to fix it? Help me,Please!

filipef101 commented 5 years ago

This is because you are passing an invalid array or something other than an array

crobinson42 commented 5 years ago

i found this issue when searching around (here's our issue https://github.com/lawnstarter/react-native-picker-select/issues/204). We solved by not passing an index value that does not exist (most likely a different API from react-native-picker-select but same solution).