question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] not all images are shown

See original GitHub issue

Hey guys,

Description

I’ve created sample app, that should show 100 images. Actual: App randomly shows around 50% of the images. example1, example2 Expected: All 100 images should be shown.

Reproduction Steps and Sample Code

Download the app where the issues reproduces: rnapp.zip

Repro steps:

  1. Perform react-native init rnapp command.
  2. Add 100 images in the ./images folder
  3. Change index.android.js file like this:
import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Image,
  View
} from 'react-native';

export default class rnapp extends Component {
  render() {
    return (
      <View style={styles.container}>
        <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
          <Image style={styles.image} resizeMode={Image.resizeMode.contain} source={require("./images/laptop_phone_howitworks.1.png")}/>
          ...
          <Image style={styles.image} resizeMode={Image.resizeMode.contain} source={require("./images/laptop_phone_howitworks.100.png")}/>
        </View>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  image: {
    width: 25,
    height: 25,
    margin: 3,
  }
});

AppRegistry.registerComponent('rnapp', () => rnapp);

Additional Information

  • React Native version: 0.43.3
  • Platform: Android
  • Development Operating System: Windows
  • Dev tools: Android Studio version 2.3.1, Android SDK version 23

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:13
  • Comments:25 (1 by maintainers)

github_iconTop GitHub Comments

21reactions
sergey-akhalkovcommented, Apr 21, 2017

Hi @nihgwu, thanks for the clarification. Do I get it right that the root cause of this issues is a memory problem? As of now, I’ve found a workaround that fixes the issue: add android:largeHeap="true" to AndroidManifest.xml Application section.

10reactions
pepaveselycommented, Jul 16, 2017

For me, https://github.com/facebook/react-native/issues/10569 worked very well. I’m using ScrollViews and setting removeClippedSubviews={true} solved my issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Can't I See My Pictures in My Gallery? [Causes & Fixes]
Part 2: What If Android Gallery Doesn't Show Pictures? (11 Tricks) · Trick 1: Ensure you didn't close the camera immediately after snapping ......
Read more >
Gallery not showing images on Android? Here's How to Fix it
How to Fix “Gallery Not Showing Images” Issue on Android · Download & install both ES File Explorer and Media Rescan apps on...
Read more >
Pictures and videos not showing in the gallery
Solution 1 · Go to File manager -> Android -> Data -> com.android. · Delete the folder ( com.android. · Go to Settings...
Read more >
How To Fix Google Photos Not Showing All Photos On Android
The first thing we recommend you should do to fix Google Photos not showing all photos on Android is to erase the app...
Read more >
How to Fix Android Gallery not Showing Pictures - Techilife
Further | android gallery not showing pictures · Enable Media visibility for individual users on Android as well. · Turn on specific user...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found