expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
772 stars 81 forks source link

white screen on Expo Updates #2292

Open JoezerSmaniotto opened 5 months ago

JoezerSmaniotto commented 5 months ago

Build/Submit details page URL

https://expo.dev/accounts/pnt-mobile/projects/pnt-mobile-v2/submissions/8d921270-fa2c-4531-8595-eb1d0c36aa8f

Summary

Using Expo Update, when receiving updates/Checking for updates, a WHITE SCREEN appears? I found a similar error https://stackoverflow.com/questions/70705994/expo-api-for-app-updates-resulting-in-blank-white-screen In my case I have the following error, whenever there are updates the project starts checking for updates, leaving the screen blank for a few seconds, after which it is directed to the project's home screen, without the need to close the project on Android

I am running update check in app.ts with the following code. codeUpdate

useEffect(() => { async function onFetchUpdateAsync() { try { const update = await Updates.checkForUpdateAsync(); if (update.isAvailable) { await Updates.fetchUpdateAsync(); await Updates.reloadAsync(); } } catch (error) { console.log(Error fetching latest Expo update: ${error}); } } if (!__DEV__) { onFetchUpdateAsync(); } }, []);

codeUpdate

Managed or bare?

managed

Environment

WARNING: We recommend using PowerShell or Bash via WSL 2 for development with Expo CLI on Windows. You may encounter issues using cmd.exe.

✔ Check Expo config for common issues ✔ Check package.json for common issues ✔ Check native tooling versions ✔ Check dependencies for packages that should not be installed directly ✔ Check for common project setup issues ✔ Check npm/ yarn versions ✔ Check for issues with metro config ✔ Check Expo config (app.json/ app.config.js) schema ✔ Check that native modules do not use incompatible support packages ✔ Check for legacy global CLI installed locally ✔ Check that packages match versions required by installed Expo SDK ✔ Check that native modules use compatible support package versions for installed Expo SDK

Didn't find any issues with the project!

Error output

No response

Reproducible demo or steps to reproduce from a blank project

Using Expo Update, when receiving updates/Checking for updates, a WHITE SCREEN appears? I found a similar error https://stackoverflow.com/questions/70705994/expo-api-for-app-updates-resulting-in-blank-white-screen In my case I have the following error, whenever there are updates the project starts checking for updates, leaving the screen blank for a few seconds, after which it is directed to the project's home screen, without the need to close the project on Android

However, when running "npx expo-doctor" to check the project configuration and compatibility of dependencies with the Expo SDK, I got this return. codeUpdate

I am running update check in app.ts with the following code

useEffect(() => { async function onFetchUpdateAsync() { try { const update = await Updates.checkForUpdateAsync(); if (update.isAvailable) { await Updates.fetchUpdateAsync(); await Updates.reloadAsync(); } } catch (error) { console.log(Error fetching latest Expo update: ${error}); } } if (!__DEV__) { onFetchUpdateAsync(); } }, []);

codeUpdate

vargajacint commented 4 months ago

Hey @JoezerSmaniotto, Did you found any solution?

JoezerSmaniotto commented 4 months ago

yes @vargajacint , inside eas.json I added "EX_UPDATES_ANDROID_DELAY_LOAD_APP": "false" build->production->env

{ "cli": { "version": ">= 3.9.1", "requireCommit": true }, "build": { "common": { "node": "18.16.0", "ios": { "resourceClass": "m-medium" } }, "production": { "extends": "common", "distribution": "store", "channel": "production", "env": { "EX_UPDATES_ANDROID_DELAY_LOAD_APP": "false" } }, "development": { "extends": "common", "developmentClient": true, "channel": "development", "distribution": "internal" }, "preview": { "extends": "common", "distribution": "internal", "channel": "preview" } }, "submit": { "production": {} } }

vargajacint commented 4 months ago

@JoezerSmaniotto Thank you.

I had the same problem on iOS, for me, the solution was removing the Alert.alert calls in the App.tsx file (lol)

WellingtonSouzaAbreu commented 3 months ago

I had the same error, the .env environment variables were not configured correctly in eas secrets