react-native-dynamic-bundle icon indicating copy to clipboard operation
react-native-dynamic-bundle copied to clipboard

Local images disappeared after applying new bundle

Open chesovnik opened this issue 4 years ago • 4 comments

After downloading and applying a new bundle all local image assets (png) not displaying in the app.

I'm creating new bundle with this command: react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

What can be the reason for such a problem?

RN 60.4

chesovnik avatar Mar 08 '20 13:03 chesovnik

AFAIK, any images included through the standard bundling mechanism do not have stable identities and are not guaranteed to be accessible if you build a newer version, although I never investigated this. If I wanted to use this I'd consider also loading the assets over HTTP at the same time as the new bundle.

Alternatively, you could stick some debugging into the new bundle and look what files / assets it's trying to load, and if these exist...

mauritsd avatar Mar 08 '20 20:03 mauritsd

@mauritsd thanks for a response! Yes, of course, any images included through the standard bundling mechanism. But any images are displayed after applying the new bundle (an old one too). All static images that were delivered to the app with initial APK installation have disappeared.

I mean, if some people use this package do they have any static images? Is there anybody else who experienced this issue or somebody who has local assets?

I have investigated that js-bundle includes paths to static images with hashes. None of these paths and hashes were changed in the new bundle. Also any errors in logs. So it is not clear what happens under the hood of this package when I apply a new bundle.

Such an issue also has microsoft/react-native-code-push package that uses a similar idea of updating js-bundle of the app.

I will be grateful for the feedback or any related thoughts

chesovnik avatar Mar 10 '20 11:03 chesovnik

this may help: https://stackoverflow.com/questions/60896279/resolving-assets-relative-to-react-native-bundle-file-outside-project-root

ryzhak avatar Mar 28 '20 18:03 ryzhak

Did you end up solving this issue?

mobinni avatar Apr 19 '22 18:04 mobinni