Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images won't display on certain Android devices #20172

Closed
ghost opened this issue Jul 12, 2018 · 4 comments
Closed

Images won't display on certain Android devices #20172

ghost opened this issue Jul 12, 2018 · 4 comments
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: For Stack Overflow A question for Stack Overflow. Applying this label will cause issue to be closed. Resolution: Locked This issue was locked by the bot. Type: Discussion Long running discussion.

Comments

@ghost
Copy link

ghost commented Jul 12, 2018

GitHub Issues in the facebook/react-native repository are used exclusively for tracking bugs in React Native. GitHub may not be the ideal place to ask questions about using React Native, but we have compiled a list of resources that should help.

Get help with your React Native app or ask code-level questions

Many members of the community use Stack Overflow to ask questions. Read through the existing questions tagged with react-native or ask your own!

Talk about best practices or propose changes to React Native

For longer-form conversations about React Native, we’ve set up a discussion forum at discuss.reactjs.org. This forum is a great place for discussion about best practices and application architecture as well as the future of React Native.

Chat with React and React Native community members

If you need an answer right away, check out the Reactiflux Discord community. There are usually a number of React Native experts there who can help out or point you to somewhere you might want to look.


I've been developing a mobile app using React Native and deploying it onto a Samsung Galaxy S6 Edge for testing purposes via Expo. So far, everything has worked fine and all of the images I'm using have displayed correctly.

However, when I've tried to deploy it onto other devices, certain images have failed to display. On the Huawei MediaPad, the header image (encased in an tag) fails to display and on the Samsung Galaxy S8 and the OnePlus 6, the background image (encased in an tag) fails to display.

I've attempted running a compiled APK file of the app, believing that these issues could be related to streaming the images over Wi-Fi, but to no avail. Interestingly though, the background image displayed fine across all devices until I swapped it out for a new image (as the predecessor was merely a placeholder). Both images are 4K (3840 x 2160), with the only difference being the storage size of the image. As a debugging measure, I compressed the new image in Photoshop with the strongest setting but, again, to no avail.

Below is the code I am using to render the two Images (not a complete paste of course, but I'm happy to do so on request):

<ImageBackground
        source={require('./../../assets/images/bg_portrait_dots.png')}
        style={{width: '100%', height: '100%', position: 'absolute'}}
        >
            <View style={styles.parentView}>
                <View style={styles.elementSpacer}>
                    <Image
                        source={require('./../../assets/images/iview_learning_logo.png')}
                        style={styles.headerImage}
                    />
                </View>

Below are the Stylesheet arguments which control the elements listed above:

parentView: {
    flex: 1,
    flexDirection: 'column',
    padding: 30,
    justifyContent: 'center',
},
headerImage: {
    width: null,
    resizeMode: 'contain',
    height: 120,
    position: 'relative',
},
elementSpacer: {
    flex: 1,
},
@react-native-bot react-native-bot added Type: Discussion Long running discussion. Platform: Android Android applications. labels Jul 12, 2018
@charpeni
Copy link
Contributor

Can you provide a snack that reproduce the issue? https://snack.expo.io/

@ghost
Copy link
Author

ghost commented Jul 12, 2018

Been trying since you left your comment to get it working in snack but keep getting silly errors from it, is there any way I can send my app to you without having to copy it all into Snack?

@charpeni
Copy link
Contributor

charpeni commented Jul 12, 2018

You can extract only "bugged" images into a simple snack or maybe share a GitHub repo. Otherwise, it's hard to debug an issue without a repro and problematic images.

@hramos hramos added Resolution: For Stack Overflow A question for Stack Overflow. Applying this label will cause issue to be closed. and removed Type: Discussion Long running discussion. labels Jul 17, 2018
@react-native-bot react-native-bot added Type: Discussion Long running discussion. Ran Commands One of our bots successfully processed a command. labels Jul 17, 2018
@react-native-bot
Copy link
Collaborator

Please use Stack Overflow for this type of question.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 18, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: For Stack Overflow A question for Stack Overflow. Applying this label will cause issue to be closed. Resolution: Locked This issue was locked by the bot. Type: Discussion Long running discussion.
Projects
None yet
Development

No branches or pull requests

3 participants