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.

Images not loading on Android

See original GitHub issue

The library works perfectly on iOS, but a Swiper of Images on the Android version won’t display its images. The code:

<Swiper showsButtons={false} style={{}} loop={true} height={screenWidth} width={screenWidth}
      dot={<View style={{backgroundColor: 'rgba(255,255,255,.7)', width: 5, height: 5, borderRadius: 4, marginLeft: 3, marginRight: 3, marginTop: 3, marginBottom: 3}} />}
      activeDot={<View style={{backgroundColor: '#49D2FF', width: 8, height: 8, borderRadius: 4, marginLeft: 3, marginRight: 3, marginTop: 3, marginBottom: 3}} />}
      paginationStyle={{bottom: 10,}} >
           {finalPhotos.map((item, key) => {
              return (
               <Image key={key} style={{flex:1,width:screenWidth,height:screenWidth,}} source={key === 0 ? (item == "none" ? require("./img/missing-pic-icon.png") : {uri:item}) : {uri:item.image}} />
              );
      })}
</Swiper>

Other details to note: -Once again, there are no issues on iOS -The swiper is contained in a View that’s contained in another Swiper -The finalPhotos array is made before returning the overall render function

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:17
  • Comments:15

github_iconTop GitHub Comments

7reactions
jackuhancommented, Apr 5, 2017

same in flatlist on Android. but not in flatlist on iOS.

6reactions
arminsal1commented, Apr 6, 2017

I found a workaround for this bug by following the second answer to this question on StackOverflow: https://stackoverflow.com/questions/30626030/can-you-force-a-react-component-to-rerender-without-calling-setstate

I used setTimeout for 100 milliseconds in the ComponentDidMount function to execute the setState. The solution will refresh the Swiper so that the images appear on Android without having to re-render everything.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix pictures not showing on Google Chrome
How to fix pictures not showing on Google Chrome · Check if the “show images” setting is enabled · Clear browser cache and...
Read more >
Fix: Images not loading in Chrome for Android - Mobile Internist
Fix: Images not loading in Chrome for Android · Clear cache from Chrome · Clear browsing data · Disable Beta features · Uninstall...
Read more >
Why Can't I See My Pictures in My Gallery? [Causes & Fixes]
Trick 4: Clear the Gallery's cache files · Navigate to your phone's "Settings". · Proceed to "Application Management"/"App" > "Gallery". · Hit " ......
Read more >
Android: Why Can't Open Images and How to Fix it - ITIGIC
Close the app and erase the data · Close all apps · Google Play Services · Free up space · Try another gallery...
Read more >
7 Ways to Fix Google Chrome Not Loading Images - MakeUseOf
7 Ways to Fix Google Chrome Not Loading Images · 1. Update Google Chrome · 2. Go Incognito · 3. Check Chrome's Site...
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