Same code / setup with Expo Classic Build (OK), becomes to a White Screen with EAS Build.

We are building the same app with 2 different ways, (we must roll back to Expo Build because it works), one is with EAS Build, wich is the new way to build apps for Expo, the other way is the classic Expo Build.

With EAS Build, the build is successful (after alot of setup), but after installing the app, on runtime, show a splash screen and then a white screen, this is not happening with Expo Classic Build, in this case it works normally.

  • Both builds with the exactly same code.
  • No logs are thrown

EAS Build:
APK size: 59 Mb
Time: much longer.
Runtime: White Screen after Splash Screen.

Expo Build:
APK size: 65 Mb
Time: much faster.
Runtime: OK

Expo diagnostics:


Expo CLI 4.11.0 environment info:
    System:
      OS: Windows 10 10.0.22000
    Binaries:
      Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.5 - C:\Users\<user>\AppData\Roaming\npm\yarn.CMD
      npm: 6.14.6 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      expo: 42.0.0 => 42.0.0
      react: 16.13.1 => 16.13.1
      react-native: https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz => 0.63.2
    Expo Workflow: managed

We also used some time to get EAS up and running. It was before my summer vacation, so my memory is a bit fussy :smile:

We had some issues with the entry point of our app. We ended up having an App.tsx in our root with following code

import 'react-native-gesture-handler';
import AppStart from 'src/AppStart';
import { registerRootComponent } from 'expo';
// We need to registerRootComponent for local development with Expo GO app
registerRootComponent(AppStart);
// We need to export the app for expo EAS build services
export default AppStart;

But best way to see what is going on is to attach a logger to your device and see what is happening:

Or try with expo run:android and debug locally

Thanks @rcknti , Expo Team, is this true? On EAS documentation “getting started” is not mentioned.

register root component is not necessary since sdk 18, if you init new expo project no changes are necessary to build for eas, you just need to add eas.json

if you have registerRootComponent in your code here are instruction how to remove it registerRootComponent - Expo Documentation

White Screen after Splash Screen.

there is a lot of ways that it might be caused, check logs with adb or android studio, few common issue that it could be:

  • you are using incompatible packages(it might work in classic builds because versions there affect only js not native code)
  • you didn’t specify some env values in eas.json that are required in your app.config.js or in your code(if you set those envs locally it won’t be available on worker)

On this point:

  • you are using incompatible packages(it might work in classic builds because versions there affect only js not native code)

Expo logs an incompatibility of react-native-animatable package.

BUT, the newer version of this package does not works neither production or development.

That’s why we roll back this package to a previous version.

So: old version works but wont build as expected, new version does not works and build as expected, but crash.

How can we handle this?

  • We removed any custom app.config.js to avoid environment variables.

  • We also installed all compatible packages

Problem still exists, after splash screen a white screen ocurs.

This is our eas.json

{
  "build": {
    "release": {
      "android": {
        "releaseChannel": "prod-2100",
        "buildType": "app-bundle"
      },
      "ios": {
        "releaseChannel": "prod-2100",
        "autoIncrement": "buildNumber"
      }
    },
    "apk": {
      "android": {
        "releaseChannel": "prod-2100",
        "buildType": "apk"
      }
    },
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    }
  }
}

This is our package.json (dependencies and dev dependencies):

"dependencies": {
    "@expo-google-fonts/roboto": "0.2.0",
    "@expo/vector-icons": "12.0.5",
    "@react-native-community/netinfo": "6.0.0",
    "expo": "42.0.0",
    "expo-analytics": "~1.0.16",
    "expo-app-loading": "~1.1.2",
    "expo-asset": "~8.3.3",
    "expo-blur": "~9.0.3",
    "expo-camera": "~11.2.2",
    "expo-constants": "~11.0.2",
    "expo-device": "3.3.0",
    "expo-face-detector": "~10.1.1",
    "expo-facebook": "~11.3.1",
    "expo-file-system": "~11.1.3",
    "expo-firebase-analytics": "~4.1.0",
    "expo-firebase-core": "~3.1.0",
    "expo-font": "~9.2.1",
    "expo-image-manipulator": "~9.2.2",
    "expo-image-picker": "~10.2.3",
    "expo-linear-gradient": "~9.2.0",
    "expo-linking": "~2.3.1",
    "expo-localization": "~10.2.0",
    "expo-media-library": "~12.1.2",
    "expo-notifications": "~0.12.3",
    "expo-screen-orientation": "~3.2.1",
    "expo-sharing": "~9.2.1",
    "expo-updates": "~0.8.5",
...
  }

please use expo run:ios or expo run:android to debug your issue locally. classic builds and eas build are entirely different build systems and there could be any number of reasons that this issue could occur, likely it is related to one of the libraries you are using that is not in the expo sdk and therefore would be difficult for us to provide support on.

you can revert the changes from using the run commands as described here: fyi/prebuild-cleanup.md at master · expo/fyi · GitHub

After some days, we had time to try another build this time for debug the error.

We made a build with “developmentClient”: true, (eas build)

But app is opening OK, after Splash Screen the app loads OK.

Summary: there is no way to debug this error, because this is happening only in eas release builds (no logs, also sentry does not throw logs/errors).

We don’t want to revert changes because we still can build with Classic builds.

We want to change to Eas Build to include new native modules (as InApp purchases).

This ticket is still opened.

you will need to investigate this issue on your own unless you can provide a minimal reproducible example that demonstrates it is an issue with our tooling.

this is happening only in eas release builds

this is only happening in release builds of your app - the fact that it happens on EAS is not relevant. you can use expo run as i suggested above to reproduce this locally. you can open the project in xcode or android studio after doing so and set breakpoints and debug further. or you can follow this manual debugging advice for a more brute force approach.

good luck!

you can use expo run as i suggested above to reproduce this locally.

I’m telling you this happens only in release builds with EAS.

It works with Expo Go.
It works with Expo Dev Client.
It works with Classic Builds
It works with Local Development.

The only way this not works it’s after Building with EAS Build for Release.

We are going to make a minimal reproducible repository to be able to share the code, @notbrent please delegate this ticket to another member of your team with help mentality, i think you are not able to help.

a build on eas build is just a release build. so you can do expo run:ios --configuration Release or expo run:android --variant release to create the same result.

if indeed this works as expected, you now know an important factor: something about running the build on your computer vs on eas build is different. so you may want to then investigate your environment variables set in eas.json or in secrets.

Hi @trivudev

Were you able to try it with expo run:ios and/or expo run:android? If so, did the problem also happen in that case?

1 Like