[iOS] Missing bundled scripts and assets in IPA, won't work offline

Since this is an ejected ExpoKit:

‘exp build’ is not supported for detached projects

We have partially solved the missing assets, by manually replacing:

/ios/<appname>/Supporting/shell-app-manifest.json <----- /dist/ios-index.json
/ios/<appname>/Supporting/shell-app.bundle <----- /dist/bundles/ios-<hash>.js

This allows us to build and archive the app using Xcode. It will launch OK, even without a network connection first-time. Which is great!

However, our bundled image assets aren’t displaying. Interestingly, bundled fonts do work.

We’ve inspected the Archived .ipa/Payload to see what assets are actually being bundled.

Working OK were:

  • Images from React Navigation and the app icon/ splash screen
  • Icon fonts
  • Custom fonts we added

Our image files appear to be there, but they are all just 243 bytes.

asset_0b114a00a26ef7c72ca9f57d05273699.png

Opening the file gives this:

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>C8F50820A16A9DBB</RequestId><HostId>0hFK9Dir/oRF3ghG4G9C1Ls6bg5kwi8s+mKXBm1GsnXRuaf1ME12jrErTxzGguhQpuDqbCMCkVs=</HostId></Error>

Which looks like it might be an error message from AWS? Maybe, somehow the build process is attempting to fetch these images from AWS, instead of using the /dist bundle, as it did correctly for the fonts.

The fact the fonts are bundled correctly, but not the images is very strange.

2 Likes