Android crash on press select
See original GitHub issueDescribe the bug
When i click on the select on Android the application crash.
This is the log from the Android Studio console:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.wtaapp, PID: 4475
com.facebook.react.bridge.NoSuchKeyException: label
at com.facebook.react.bridge.ReadableNativeMap.getNullableValue(ReadableNativeMap.java:137)
at com.facebook.react.bridge.ReadableNativeMap.getNullableValue(ReadableNativeMap.java:141)
at com.facebook.react.bridge.ReadableNativeMap.getString(ReadableNativeMap.java:192)
at com.facebook.react.views.picker.ReactPickerManager$ReactPickerAdapter.getView(ReactPickerManager.java:126)
at com.facebook.react.views.picker.ReactPickerManager$ReactPickerAdapter.getDropDownView(ReactPickerManager.java:112)
at android.widget.Spinner$DropDownAdapter.getDropDownView(Spinner.java:1022)
at android.widget.Spinner$DropDownAdapter.getView(Spinner.java:1018)
at android.widget.Spinner.measureContentWidth(Spinner.java:860)
at android.widget.Spinner$DropdownPopup.computeContentWidth(Spinner.java:1255)
at android.widget.Spinner$DropdownPopup.show(Spinner.java:1281)
at android.widget.Spinner.performClick(Spinner.java:784)
at android.support.v7.widget.AppCompatSpinner.performClick(AppCompatSpinner.java:443)
at android.view.View$PerformClick.run(View.java:24931)
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:7523)
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
This is my configuration:
render() {
let styleShadow = {}
if (this.props.shadow) {
styleShadow = {
shadowColor: config.colors.black,
shadowOffset: { width: 0, height: 3 },
shadowOpacity: 0.15
}
}
const style = [{
paddingLeft: this.props.icon ? 40 : 15,
paddingRight: 15,
paddingTop: 10,
paddingBottom: 10,
backgroundColor: config.colors.white,
borderColor: this.state.borderColor,
borderWidth: 1,
fontFamily: config.fonts.poppins,
borderRadius: 10,
}, styleShadow]
return (
<View style={[{
marginBottom: 15,
position: 'relative'
}]}>
<PickerSelect
style={{
inputAndroid: style,
inputIOS: style,
done: { color: config.colors.red },
placeholder: { color: config.colors.black }
}}
items={this.props.items}
onValueChange={this.props.onChangeText}
placeholder={this.props.placeholder}
value={this.props.value}
useNativeAndroidPickerStyle={false}
doneText="Confirm"
/>
</View>
)
}
Smartphone:
- Device: Huawei P8 lite 2017
- OS: Android 8.0.0
- react-native-picker-select version: 6.2.0
- react-native version: 0.59.5
- react version: 16.8.3
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Android studio app crashes on the button click - Stack Overflow
The product form is shown every time when I click on the Add new Product button. But I can't select a product in...
Read more >Crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
Read more >Why do my apps keep crashing on Android, How to fix it
To do this, go to Settings -> Apps and select the app that keeps crashing. Tap on the app's name and then tap...
Read more >Long pressing on text to select it instantly crashes the app.
If I long press on any text in the app to start the selection process (highlight for copy/paste), the app instantly crashes.
Read more >Troubleshooting Mobile - Android - Teamfight Tactics Support
You're settling in on the couch to play on your phone, ready to climb the ranks and master some team comps when, suddenly,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My problem was related to the placeholder props. I pass a string as props insthead of an object with same keys like an option object.
I was also experiencing the same crash. Similar solution to above. I was already passing in a placeholder object like so -
BUT, I discovered
someLabel
andsomeValue
wereundefined
. So I had to ensure that those values were getting thru, and then it worked.