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

[iOS] Images under `assetBundlePatters` not appearing on first-load-offline #2060

Closed
kr31n3r opened this issue Jul 31, 2018 · 10 comments

Comments

Projects
None yet
9 participants
@kr31n3r
Copy link

commented Jul 31, 2018

TL;TR

iOS standalone (image) assets are properly bundled but won't show up offline (first).

See also: https://forums.expo.io/t/ios-standalone-assetbundlepatterns-regression/12103

Environment:

OS: macOS Sierra 10.12.6
Node: 10.7.0
Yarn: 1.9.2
npm: 6.2.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.1 AI-173.4720617

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

App target: iOS standalone

Steps to Reproduce

  1. configure assetBundlePatterns in app.json to bundle some image assets
  2. run exp build:ios -t simulator to create an iOS standalone simulator build
  3. wait for build to finish then download and unpack YourAppName.tar.gz
  4. start iOS simulator and run xcrun simctl install booted YourAppName.app
  5. disable internet connection
  6. start YourAppName inside iOS simulator
  7. your bundled images won't show up

Expected Behavior

Bundled image assets should work offline (first).
The same codebase works as expected for android standalone builds.

Actual Behavior

iOS bundled images won't show up.

Reproducible Demo

Any recent iOS standalone build should face this issue.

@quinlanj quinlanj self-assigned this Aug 1, 2018

@terribleben terribleben changed the title [iOS standalone] assetBundlePatterns regression [iOS] Images under `assetBundlePatters` not appearing on first-load-offline Aug 2, 2018

@terribleben terribleben assigned tsapeta and unassigned quinlanj Aug 2, 2018

@terribleben

This comment has been minimized.

Copy link
Contributor

commented Aug 2, 2018

Thanks for the report, we have reproduced the issue and somebody is looking at it.

@sjchmiela sjchmiela self-assigned this Aug 3, 2018

@ankit992

This comment has been minimized.

Copy link

commented Aug 6, 2018

The issue also happens on Android in addition to iOS.

@drpancake

This comment has been minimized.

Copy link

commented Aug 6, 2018

I'm also seeing this issue on both Android and iOS.

Reverting to SDK 28 fixed Android for me, but not iOS.

@terribleben

This comment has been minimized.

Copy link
Contributor

commented Aug 6, 2018

Fix landed internally for iOS. We'll roll it out to our exp build service early this week.

@sukso96100

This comment has been minimized.

Copy link

commented Aug 10, 2018

Hi, Was the fix rolled out for exp build service? I'm also experiencing this issue on Android.

This is what i expected to see on first run with the apk file built with exp build:android.
screenshot_20180810-104456

And this is what i actually see at first run.
screenshot_20180810-110743

If i stop by some other screens, then i can see the images like the screenshot.
screenshot_20180810-111116

@sjchmiela

This comment has been minimized.

Copy link
Contributor

commented Aug 13, 2018

When it comes to iOS, the fix has been deployed 6 days ago and I just confirmed it fixed the problem on iOS (I also had to add these two lines at the top of the App.js file):

import { Asset } from 'expo';
Asset;

Please try to rebuild your apps and see whether the issue is fixed. If it's not, please open a new issue (the underlying reason of this issue has been fixed). 🙂

@sjchmiela sjchmiela closed this Aug 13, 2018

@sjchmiela sjchmiela removed the in review label Aug 13, 2018

@riwu

This comment has been minimized.

Copy link
Contributor

commented Aug 13, 2018

Why is it necessary to add these 2 lines? It wasn't needed before.
Is it mandatory now due to the changes related to Universal Modules?

Is it also fixed on Android?

@sjchmiela

This comment has been minimized.

Copy link
Contributor

commented Aug 13, 2018

It's a bug introduced while moving Asset to expo-asset. The following lines have to be called prior to loading any assets by React Native. Including Asset like in
#2060 (comment) executes those lines.

https://github.com/expo/expo-asset/blob/6698f2a6dc657a0b12bf29a22e62c83c9fd8ed3a/src/Asset.js#L186-L190

@riwu

This comment has been minimized.

Copy link
Contributor

commented Aug 13, 2018

So this workaround will not be necessary in the next Expo release (in which the bug will be fixed)?
Could you also confirm if the issue is resolved on Android too?
Thanks!

@sukso96100

This comment has been minimized.

Copy link

commented Aug 13, 2018

@riwu I just tried a new build after adding two lines from this comment and it's fixed.

@lock lock bot added the outdated label Jun 14, 2019

@lock lock bot locked and limited conversation to collaborators Jun 14, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.