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.

Xcode 11: Error loading local image when build release

See original GitHub issue

In Xcode 10 everything is okay but after upgraded to Xcode 11 and build release, the local image not showing in iOS both Simulator and Real Device.

React Native Environment Info:
    System:
      OS: macOS 10.14.6
    Binaries:
      Node: 10.13.0 - /usr/local/bin/node
      Yarn: 1.17.3 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
    IDEs:
      Xcode: 11.0/11A420a - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.9 => 0.59.9 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Steps To Reproduce

  1. react-native run-ios --configuration Release either run release from Xcode
  2. Local image not showing
react-native run-ios react-native run-ios --configuration Release

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:24

github_iconTop GitHub Comments

12reactions
nysamnangcommented, Oct 30, 2019

@pabloluz I temporarily fixed this issue by the following:

  1. Navigate to project directory => ios => Create folder assets
Screen Shot 2562-10-30 at 8 54 35 AM
  1. Inside folder assets => create folder structure same as folder where you keep image in the project (In my case I kept all the images in app > src > assets > image) and copy all images to this folder

  2. Open Xcode => Select project target => Build Phases

  3. Drag folder assets which we have created into Copy Bundle Resources

Screen Shot 2562-10-30 at 9 15 00 AM
  1. Select Copy items if needed and press Finish
Screen Shot 2562-10-30 at 9 16 16 AM
  1. Clean project and Build release again

Done!

PS: If your images name like this my_image.ios.jpg you need to rename them to my_image.jpg.

7reactions
enebezecommented, Jan 29, 2020

In my case I was using resizeMode=‘center’ and when I changed from ‘center’ to ‘contain’ it solved my problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native iOS release build Error loading local images and ...
after release build 'No bundle Error' gone but in my release build there is no local images or icon. after giving release build....
Read more >
No images when building with xCode 12 Beta - Apple Developer
No local nor remote images are loading. It works with no problem on Android in the same machine, as well as in my...
Read more >
React-Native Ios Release Build Error Loading Local ... - ADocLib
We build a new image each time a new stable or beta version of Xcode is released by Binaries will need to be...
Read more >
Fix Images Not loading In iOS 14 — React Native | by jQN
Today I decided to finally upgrade Xcode to version 12.0.1 which means the simulators were also upgraded to iOS version 14. The project...
Read more >
Loading local image in react native 0.60.3 and Xcode 11 ...
[Solved]-Loading local image in react native 0.60.3 and Xcode 11-React Native. Search. score:0. <Image resizeMode="contain" style={{ width: props.width, ...
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