Reputation: 228
After Adding Picker for Android that running in debugging mode but after release apk dont show picker value. note-apk is running on all devices only issue for new android devices their os is above than 9.+
react-native picker
<Picker
selectedValue={this.state.loginAs}
style={styles. newpicker}
onValueChange={(itemValue, itemIndex) =>
this.setState({loginAs: itemValue})
}>
picker value display in dropdown list
Upvotes: 1
Views: 82
Reputation: 228
After many I found the working solution for this. please try with the following solution and update on same.
The code was working fine for debug
build not for Release APK
.
My old code:-supporting for old device not for the OS
version above 9.+
<Picker
selectedValue={this.state.loginAs}
style={styles. newpicker}
onValueChange={(itemValue, itemIndex) =>
this.setState({loginAs: itemValue})
}>
<Picker.Item label="Select login As..." value="Select login As..." color='#9EA0A4'/>
{this.state.loginData.map((item, index) => {
return (
<Picker.Item label={item.role} value={item.role} key={index}/>)
})}
</Picker>
Working Solution
Added Following Line into the AndroidManifest.xml
because the reason is I was using http
in webAPI
if you are using http url
add following line else no need .
android:usesCleartextTraffic="true"
Upvotes: 1