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

Local Images are not showing after building the IPA file Xcode - 12, IOS -14 #31968

Closed
snevula123456 opened this issue Aug 5, 2021 · 19 comments
Labels
Component: Image Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@snevula123456
Copy link

snevula123456 commented Aug 5, 2021

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

I am facing an Local Image not loading on the Screens Issue after building the IPA file on Xcode - 12, IOS - 14 versions.
Local Images are showing while Development on the simulator.

React Native version:

react-native : 0.64.2,
Xcode Version : 12.0.1 (12A7300),

Steps To Reproduce

  1. Ejected Expo react-native app.
  2. updated the pod install
  3. open .xcodeWorkspace file and then try to archive.
  4. open the app in the Iphone
  5. Local asset images are not showing.

Expected Results

It should display the all the local images on the screen, after building the app.

Debugging Links Followed

1 . Tried to https://stackoverflow.com/questions/35354998/react-native-ios-app-not-showing-static-assets-images-after-deploying solutions but still no use.

  1. Tried Image cannot show image in iOS 14 #29279 solutions but still no luck.

image
The Above Screenshot code is already available in the file.

Snack, code example, screenshot, or link to a repository:

image

image

Thanks In Advance.

@ianberryman
Copy link

Same issue here on RN 0.63.4 and XCode 12.5.1. Recommend fixes don't work. Local images work in simulator but not on physical devices.

@safaiyeh safaiyeh added Component: Image Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: iOS iOS applications. and removed Needs: Triage 🔍 labels Aug 6, 2021
@github-actions
Copy link

github-actions bot commented Aug 6, 2021

⚠️ Missing Reproducible Example
ℹ️ It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.

@cristianoccazinsp
Copy link
Contributor

Something similar happens with defaultSource and local images. RN 0.65.1

@talaikis
Copy link

talaikis commented Sep 11, 2021

<Image onError={...} source={require(xxx)} /> gives appName.app/assets/assets/xxx not available (RN 0.65.1). The fix is basically what StackOverflow says:

  1. You have, let's say root/assets
  2. You generate the bundle with --assets-dest='./ios'
  3. Add ios/assets to copy resources (using Add other...., not just what's shown).
  4. Clean build folder and possibly every other buggy XCode nonsense (Mac shut down may help). (This one is important as I had those ios/assets added multiple times w/o any success)

@robertqin86
Copy link

robertqin86 commented Sep 22, 2021

I'm unfortunately experiencing this issue as well. It seems to be introduced with the upgrade to 0.64.2. My local image works fine in development but not when I package a release build. This was not an issue at my last release when I was at 0.63.4

@borg
Copy link

borg commented Sep 26, 2021

Still an issue on RN 0.65.1

Tried all those steps @talaikis, even cleaned my room, no dice.

It' s odd because compiler doesn't complain about missing images, and when adding to build phase assets are clearly embedded, which makes me suspect it is more a debug/release path difference issue. Works in debug, not in release. Reverting to use Images.xcassets until this is solved.

@talaikis
Copy link

Still an issue on RN 0.65.1
Tried all those steps @talaikis, even cleaned my room, no dice.

I had a lot of old bundle issues on Xcode, went to build an app on fastlane and all them seems solved, at least for now. Not even try tp launch Xcode.

@vuletuanbt
Copy link

Still an issue on RN 0.65.1

Tried all those steps @talaikis, even cleaned my room, no dice.

It' s odd because compiler doesn't complain about missing images, and when adding to build phase assets are clearly embedded, which makes me suspect it is more a debug/release path difference issue. Works in debug, not in release. Reverting to use Images.xcassets until this is solved.

I'm facing it. How do you resolve it?

@abhinavrathore019-gh
Copy link

This solution works for me images not showing up on release build

@henrique-in
Copy link

Anyone managed to find a solution, I'm having the same problem in react native 0.63.4

@cristianoccazinsp
Copy link
Contributor

Try with RN 0.67.x

@borg
Copy link

borg commented Feb 18, 2022

In my case issue remained even if upgraded to RN 0.67.2.
I thought it was caused by me using babel-plugin-module-resolver following this isssue
but the main.jsbundle and asset structure inside the MyApp.app were identical to a fresh working 0.67 build.

Turns out I had remnants of expo inside my AppDelegate and at least one of these expo-updates and expo-asset call a build script that changes the relative asset path of the final binary after it has been bundled.

Replacing the EXUpdatesAppController calls inside didFinishLaunchingWithOptions with the normal RN options finally fixed it.

@henrique-in
Copy link

henrique-in commented Feb 18, 2022

Solved the problem by adding this to metro.config.js

transformer: {
assetPlugins: ['expo-asset/tools/hashAssetFiles'],
},

@LkyYuen
Copy link

LkyYuen commented May 25, 2022

any updates??

@pedrilla
Copy link

да, any updates?

@JohnEmanuel
Copy link

Hi guys this worked for me:
#26699 (comment)

@wfrsnk
Copy link

wfrsnk commented Oct 17, 2022

be sure of using latin alphabet in name of image, this typo killed a lot of time for me :/

@github-actions
Copy link

github-actions bot commented Feb 2, 2023

This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 2, 2023
@github-actions
Copy link

github-actions bot commented Feb 9, 2023

This issue was closed because the author hasn't provided the requested feedback after 7 days.

@github-actions github-actions bot closed this as completed Feb 9, 2023
@facebook facebook locked as resolved and limited conversation to collaborators Feb 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: Image Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests