[iOS standalone] assetBundlePatterns regression?

Hi all,

In my environment after building the app with

exp build:ios -t simulator

I do see the hashed asset files configured by assetBundlePatterns inside the simulator build. They are correctly bundled and are valid files.

However if I start the simulator build offline the (asset) images are not displayed.

The same code works right now for android standalone builds and worked before updating SDK-28 and exp-cli.

Environment:

OS: macOS Sierra 10.12.6
Node: 10.5.0
Yarn: 1.7.0
npm: 6.1.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.1 AI-173.4720617
exp: 55.0.5

Packages: (wanted => installed)
expo: ^29.0.0 => 29.0.0
react: 16.3.1 => 16.3.1
react-native: https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz => 0.55.4

Update:

Reverting back to SDK-28 does not fix this issue for me.
Reverting back to SDK-28 and reverting back to exp 55.0.4 does not fix this issue for me.

hi @languste, there is a known issue in our current SDK 29 release where our Assets module is lazily loaded. To confirm that this is indeed the issue in your case, could you make the following changes to your app:

import Expo from 'expo';
Expo.Asset; // <----- Add this line here

This will explicitly load the Asset module (if our module doesnt get loaded in time, it falls back to React Native’s default Asset module behavior which does not take into account bundled assets)

Thank’s for the quick response @quinlanj!

I tried your suggestion (on different code locations) but it does not to fix this issue for me :frowning: .
Any further tips or recommondations to debug this?

  • maybe debugging /usr/local/lib/node_modules/exp/node_modules/xdl/build/Project.js and comparing hashes?
  • or adding some debug code to figure out if React Native’s asset resolution for Image components has been overwritten or not?

Furthermore it would be nice if someone could confirm this issue. Any recently iOS (simulator/standalone) build with assetBundlePatterns configured should be sufficient to trigger this issue on a cold/offline first start.

I got the same issue. All the images that bundled with app won’t load at all. I tried the code above but it didn’t work, the app still require the internet connection to load the images.

hi @languste and @hienvan ,
This is probably a bug on our end (maybe coinciding with our new SDK release?)

If you could file an issue at !https://github.com/expo/expo/issues) and provide a repro, that’d be really helpful. Thanks!

1 Like

More infos here:
https://github.com/expo/expo/issues/2060

2 Likes

@languste thank you for filing this!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.