Android version not work on Samsung S6
See original GitHub issueHi, i have this component:
import React, {
PropTypes,
Component,
} from 'react';
import {
Platform,
StyleSheet,
View,
Text,
Image,
TouchableOpacity,
} from 'react-native';
import Colors from '../Styles/Colors';
import Fonts from '../Styles/Fonts';
import ImagePicker from 'react-native-image-picker';
const styles = StyleSheet.create({
container: {
margin: 16,
alignItems: 'center',
},
circle: {
width: 95,
height: 95,
borderRadius: 95 / 2,
backgroundColor: Colors.colorBgTwo,
borderWidth: 13,
borderColor: 'white',
alignItems: 'center',
justifyContent: 'center',
},
avatar: {
width: 82,
height: 82,
borderRadius: 82 / 2,
},
});
const propTypes = {
options: PropTypes.object,
};
const defaultProps = {
options: {
title: 'Select Avatar', // specify null or empty string to remove the title
cancelButtonTitle: 'Cancel',
takePhotoButtonTitle: 'Take Photo...', // specify null or empty string to remove this button
chooseFromLibraryButtonTitle: 'Choose from Library...', // specify null or empty string to remove this button
cameraType: 'front', // 'front' or 'back'
mediaType: 'photo', // 'photo' or 'video'
quality: 0.5, // 0 to 1, photos only
angle: 0, // android only, photos only
allowsEditing: false, // Built in functionality to resize/reposition the image after selection
noData: false, // photos only - disables the base64 `data` field from being generated (greatly improves performance on large photos)
storageOptions: { // if this key is provided, the image will get saved in the documents directory on ios, and the pictures directory on android (rather than a temporary directory)
skipBackup: true, // ios only - image will NOT be backed up to icloud
path: 'images', // ios only - will save image at /Documents/images rather than the root
},
},
};
class ImageUpload extends Component {
constructor(props) {
super(props);
this.state = {
avatarSource: null,
};
this.selectPhotoTapped = this.selectPhotoTapped.bind(this);
}
selectPhotoTapped() {
ImagePicker.showImagePicker(this.props.options, (response) => {
console.log('Response = ', response);
if (response.didCancel) {
console.log('User cancelled photo picker');
} else if (response.error) {
console.log('ImagePicker Error: ', response.error);
} else if (response.customButton) {
console.log('User tapped custom button: ', response.customButton);
} else {
var source;
// You can display the image using either:
// source = { uri: `data:image/jpeg;base64, ${response.data}`, isStatic: true };
if (Platform.OS === 'android') {
source = { uri: response.uri, isStatic: true };
} else {
source = { uri: response.uri.replace('file://', ''), isStatic: true };
}
this.setState({
avatarSource: source,
});
}
});
}
render() {
return (
<View style={styles.container}>
<TouchableOpacity onPress={() => { this.selectPhotoTapped(); }} >
<View style={styles.circle}>
{this.state.avatarSource === null ? <Text style={Fonts.h7ButtonPrimary}>Photo</Text> :
<Image style={styles.avatar} source={this.state.avatarSource} />
}
</View>
</TouchableOpacity>
</View>
);
}
}
ImageUpload.propTypes = propTypes;
ImageUpload.defaultProps = defaultProps;
export default ImageUpload;
On IOS it works, on Android i have this:
Can you help me?
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
Galaxy S6 “com.android.phone has stopped working” error ...
There's no amount of software troubleshooting that can fix it. As a workaround to charge the phone, you can try using a wireless...
Read more >Android Update has broken my Galaxy S6
Now when I restart the Galaxy S6 comes up the the blue screen with the Android Man , saying Installing Update, then nothing...
Read more >How to Fix App Issues on Samsung Galaxy S6 - TheCellGuide -
Go to Settings > Applications > Application manager. · Scroll to the right until you get to the All tab and select the...
Read more >25 annoying Samsung Galaxy S6 problems, and how to fix them
If that doesn't work it's time to wipe the cache partition. Press and hold Power and then choose Power off. Now press and...
Read more >10 Common Galaxy S6 Problems & How to Fix Them
If that doesn't work, you'll want to try rebooting the local router if that hasn't been done in awhile. We recommend unplugging the...
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
Should be fixed in
0.19.5
. Let me know.Hi,
, it’s work fine other device but not with Samsung galaxy tab, s3