Expo App on production failed (blank after splash)

  1. SDK Version: 40
  2. Platforms(Android/iOS/web/all): Android and iOS

Hi,

I can’t publish it on Apple Store because it has been rejected. After splash screen it appears a white screen, only in the first attempt. On the simulator, I have to close and reopen the app, and then it launches well.

On Expo, in developer mode, I can’t reproduce the error. I tried to execute the app in production mode ( expo start --no-dev --minify -c ) and then (after a while) appears the following message:

and:

There’s the package.json:

{
    "main": "node_modules/expo/AppEntry.js",
    "scripts": {
        "start": "expo start",
        "android": "expo start --android",
        "ios": "expo start --ios",
        "web": "expo start --web",
        "eject": "expo eject"
    },
    "dependencies": {
        "@react-native-async-storage/async-storage": "^1.13.2",
        "@react-native-community/datetimepicker": "^3.0.9",
        "@react-native-community/masked-view": "0.1.10",
        "@react-native-picker/picker": "1.9.2",
        "@react-navigation/bottom-tabs": "^5.6.1",
        "@react-navigation/native": "^5.6.1",
        "@react-navigation/stack": "^5.6.2",
        "expo": "^40.0.1",
        "expo-app-loading": "^1.0.1",
        "expo-auth-session": "~3.0.0",
        "expo-blur": "~8.2.0",
        "expo-facebook": "~9.1.0",
        "expo-file-system": "~9.3.0",
        "expo-google-sign-in": "~8.4.0",
        "expo-image-crop": "^1.0.4",
        "expo-image-manipulator": "~8.4.0",
        "expo-image-picker": "~9.2.0",
        "expo-linear-gradient": "~8.4.0",
        "expo-localization": "~9.1.0",
        "expo-media-library": "~10.0.0",
        "expo-notifications": "~0.8.2",
        "expo-print": "~9.2.0",
        "expo-random": "~10.0.0",
        "expo-secure-store": "~9.3.0",
        "expo-sharing": "~8.5.0",
        "expo-updates": "~0.4.1",
        "expo-web-browser": "~8.6.0",
        "fbjs": "^3.0.0",
        "firebase": "8.2.0",
        "i18n-js": "^3.7.0",
        "mobx": "^5.15.4",
        "mobx-react": "^6.2.2",
        "moment": "^2.29.1",
        "pdf-lib": "^1.15.0",
        "react": "~16.13.1",
        "react-dom": "16.13.1",
        "react-native": "https://github.com/expo/react-native/archive/sdk-40.0.0.tar.gz",
        "react-native-elements": "^3.0.0",
        "react-native-fontawesome": "^7.0.0",
        "react-native-gesture-handler": "~1.8.0",
        "react-native-image-zoom-viewer": "^3.0.1",
        "react-native-reanimated": "^1.13.1",
        "react-native-redash": "^14.2.1",
        "react-native-safe-area-context": "3.1.9",
        "react-native-screens": "~2.15.0",
        "react-native-svg": "12.1.0",
        "react-native-vector-icons": "^6.6.0",
        "react-native-web": "~0.11.7",
        "request": "^2.88.2"
    },
    "devDependencies": {
        "@babel/core": "^7.10.3",
        "babel-plugin-transform-decorators-legacy": "^1.3.5",
        "babel-preset-expo": "~8.1.0",
        "eslint": "^7.4.0"
    },
    "private": true
}

The App.js on I load the fonts and the lang:

import React, { useState, useEffect, useContext } from "react";
import AsyncStorage from "@react-native-async-storage/async-storage";
import * as Font from "expo-font";
import * as Localization from "expo-localization";
import * as firebase from "firebase";
import firebaseConfig from "../Session/firebase";
import AuthNavigator from "../Navigator/AuthNavigator";
import { LangContext } from "../Lang";
import Loading from "./Loading";

if (!firebase.apps.length) {
    firebase.initializeApp(firebaseConfig);
}

export default () => {
    const [fontLoad, setFontLoad] = useState(false);
    const [languageLoad, setLanguageLoad] = useState(false);
    const { dispatch } = useContext(LangContext);

    useEffect(() => {
        // AsyncStorage.clear();
        Font.loadAsync({
            Roboto: require("../assets/fonts/roboto-regular.ttf"),
            RobotoBold: require("../assets/fonts/Roboto-Bold.ttf"),
            RobotoLight: require("../assets/fonts/Roboto-Light.ttf"),
            RobotoBlack: require("../assets/fonts/roboto-black.ttf"),
            FontAwesome5FreeSolid: require("../assets/fonts/FontAwesome5.otf"),
            "fa-solid-900": require("../assets/fonts/FontAwesome5.otf"),
        }).then(() => setFontLoad(true));
    }, []);

    useEffect(() => {
        AsyncStorage.getItem("lang").then((lang) => {
            if (lang == null) {
                AsyncStorage.setItem("lang", Localization.locale);
                dispatch({ type: "setLanguage", payload: Localization.locale });
            } else {
                if (lang == "es-ES")
                    dispatch({ type: "setLanguage", payload: "es" });
                else if (lang == "ca-ES")
                    dispatch({ type: "setLanguage", payload: "ca" });
                else if (lang == "en-EN")
                    dispatch({ type: "setLanguage", payload: "en" });
                else dispatch({ type: "setLanguage", payload: lang });
            }
            setLanguageLoad(true);
        });
    }, []);

    if (fontLoad && languageLoad) {
        return <AuthNavigator />;
    } else {
        return <Loading />;
    }
};

I’m a little bit desperate… I tried 5 times to publish it on Apple Store and I don’t know whats going on…

Thank’s a lot

Hey @miki_kanez, I’d recommend taking a look at our guide on debugging production errors.

Cheers,
Adam

I followed the guide but I can’t get more information. The only way I can get an error is using expo start --no-dev --minify -c.

I installed Sentry but I don’t get any error.

Note: The error appears when Expo si building the Javascript Bundle (on 25%, approx). Only when I clear the cache (-c). I think this is why Sentry doesn’t work. And why the production version stucks on a white screen at the first attempt.

I tried to remove all packages and I figured out the problem, but I can’t resolve it. The problem is from firebase package, but I don’t know how to resolve it. I created a new empty project and if I remove firebase, the app builds well (without “Failed to load all assets”).