Detached project - How to include js bundle in app?

From what I understand, Expo loads js bundle from expo.host url on app load. This could be problematic if user has no internet. Any way to include the bundle in the xcode project?

Support for this is in progress, but we don’t have an exact date when it’ll be ready.

Update: I misread your original post. The JS bundle should be bundled on iOS in your Xcode project, it’s Android support that’s still pending.

@dikaiosune but how to make sure that it is bundled and how to actually check it? I put schema to release, launch on device and get error “No version compatible with this version of exponent.” All docs say that changing schema should be sufficient. But it is not.

Hey there - sorry this is poorly documented right now. On iOS make sure you run exp publish. This will bundle the JS locally and also push a copy to our servers under @yourname/your-app-slug. The Xcode Release build will automatically look for your published copy.

@ben Thank you for the swift response. I managed to launch it on device. But how do I make it work offline? I launched it without connectivity and got error thag there is a problem loading the app. I detached app to ExpoKit because I want it to have bundled music and it needs to work offline.

@ben
i have add this:

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    _window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    _window.backgroundColor = [UIColor whiteColor];
    [ExpoKit sharedInstance].publishedManifestUrlOverride=@“exp://localhost:19000”;
    [[ExpoKit sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
    _rootViewController = [ExpoKit sharedInstance].rootViewController;
    _window.rootViewController = _rootViewController;

    [_rootViewController loadReactApplication];
    [_window makeKeyAndVisible];

    return YES;
    }

now launch app i found it use localhost:19000. should i need to use 'react-native bundle ’ command and do something? how to do it? thank you all!

One thing we occasionally get is expo server takes forever to load (iPhone network spinner keeps spinning) and app is stuck in white screen. Any idea why this happens?

Slightly concerned about this and would like to turn off code fetch and only use local copy if expo server is not reliable

you dont have a spash image. I do it offline on ios. not android.

  1. EXShell.info, “isRemoteJSEnable=YES”
  2. start app in ios.
  3. copy shell.bundle to kernel.ios.bundle,
  4. drag kernel.ios.bundle to “support files”
  5. “isRemoteJSEnable=NO”

then start app only use local bundle,

Hi!

I’m still getting these problems. I’ve tried to set it up so that the app uses the included bundle, but when I try running it on iOS I get this screen:

I followed @weizeng’s instructions, except that kernel.ios.bundle was already in Support Files, and isRemoteJSEnable is set to NO (both in the plist and in app.json).

I’m using react-native 0.51 (Expo’s version, https://github.com/expo/react-native/archive/sdk-24.0.0.tar.gz), expo 24 and react 16; it’s not the latest versions because of bugs in RN 0.52, but from what I’ve read the offline bundle should also work with these versions.

What else should I check?

I’m really worried with how much work it’s taking to get my almost-done app to actually work on a phone.

The Xcode Release build will automatically look for your published copy.

This is the issue - why can’t the JS bundle just be included in the release build without it having to fetch it from a remote server? Is that currently possible?

This is the issue - why can’t the JS bundle just be included in the release build without it having to fetch it from a remote server? Is that currently possible?

This topic is very old (November 2017) and contains some misleading answers for present day. At the time of writing, here’s the current state of the world–

  • Your JS bundle is included automatically in your binary for both iOS and Android. This is true about apps created with exp build and also true for ExpoKit apps.
  • By default, we check for updates from our server, but you can disable this completely if you want.
  • You can also bundle all your other assets (images, etc.) in your binary. Newly created Expo projects will have this enabled by default, but older projects will need to add this configuration.

I’m going to close this ancient topic, but hopefully this answer helps for archival purposes!