expo / expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.
https://docs.expo.dev
MIT License
33.92k stars 5.43k forks source link

expo-splash-screen preventAutoHideAsync() seems to have no effect #31875

Open jaworskimatt opened 3 weeks ago

jaworskimatt commented 3 weeks ago

TEMPORARY SOLUTION: The bug is in 0.27.6 - downgrade to 0.27.5

Minimal reproducible example

https://github.com/jaworskimatt/splashscreentest

What platform(s) does this occur on?

iOS

Where did you reproduce the issue?

in Expo Go

Summary

Calling SplashScreen.preventAutoHideAsync(); seems to have no effect on the app, the splash screen is automatically hidden.

Steps to replicate:

npx create-expo-app@latest splashcreentest to deploy a fresh app

Edit app/_layout.tsx and comment out or delete SplashScreen.hideAsync();

npx expo start

Expected result:

Since hideAsync() is not called, the splash screen should stay forever

Actual result:

The splash screen auto-hides anyway

Environment

expo-env-info 1.2.0 environment info:
    System:
      OS: macOS 14.5
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 20.11.1 - /usr/local/bin/node
      Yarn: 1.22.22 - /usr/local/bin/yarn
      npm: 10.6.0 - /usr/local/bin/npm
      Watchman: 2024.08.26.00 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.15.2 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 24.0, iOS 18.0, macOS 15.0, tvOS 18.0, visionOS 2.0, watchOS 11.0
    IDEs:
      Android Studio: 2023.3 AI-233.14808.21.2331.11842104
      Xcode: 16.0/16A242d - /usr/bin/xcodebuild
    npmPackages:
      expo: ~51.0.28 => 51.0.36
      expo-router: ~3.5.23 => 3.5.23
      react: 18.2.0 => 18.2.0
      react-dom: 18.2.0 => 18.2.0
      react-native: 0.74.5 => 0.74.5
      react-native-web: ~0.19.10 => 0.19.12
    npmGlobalPackages:
      eas-cli: 11.0.3
      expo-cli: 6.3.2
    Expo Workflow: managed

Expo Doctor Diagnostics

> splashcreentest@1.0.0 npx
> expo-doctor

✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check native tooling versions
✔ Check if the project meets version requirements for submission to app stores
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check for app config fields that may not be synced in a non-CNG project
✔ Check for issues with metro config
✔ Check npm/ yarn versions
✔ 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 native modules use compatible support package versions for installed Expo SDK
✔ Check that packages match versions required by installed Expo SDK

Didn't find any issues with the project!
lhr000lhr commented 3 weeks ago

same, it's working in Debug mode tho.

rsoaresdev commented 3 weeks ago

same in bare workflow in this example I prevent the splash screen from hiding with SplashScreen.preventAutoHideAsync() and add an 5s simulated promise. In meanwhile the splash screen hide and appears a black screen.

It's expected to the splash screen appear while the promise is loaded.

https://github.com/user-attachments/assets/64e87fc6-7495-45d3-9e1c-460465eddba8

anonimos-23 commented 3 weeks ago

I have the same problem with bare workflow...

vsundar17697 commented 3 weeks ago

I'm having the same issue as well !

hernanhawryluk commented 2 weeks ago

I’m experiencing the same problem.

rsoaresdev commented 2 weeks ago

Using expo-splash-screen v.0.27.5 solve the problem

hernanhawryluk commented 2 weeks ago

Confirmed, using Expo 0.27.5 resolves the issue, thank you @rsoaresdev !

bytemtek commented 2 weeks ago

expo-splash-screen v.0.27.5 solve this problem but v.0.27.6 have same problem.

rsoaresdev commented 2 weeks ago

expo-splash-screen v.0.27.5 solve this problem but v.0.27.6 have same problem.

That's why I said to downgrade to expo-splash-screen v.0.27.5 till next version (0.27.7)

MrHIDEn commented 2 weeks ago

Android expo-splash-screen v.0.27.6 with experimental delay 2 sec. splash blinked in 0.3s then white screen for 1.7s and app is starting...

That is really wrong.

hernanhawryluk commented 2 weeks ago

I had the exact same issue you’re describing. You need to downgrade to version 0.27.5 until 0.27.7 is released with a fix.

In the meantime, simply run:

npx expo install expo-splash-screen@0.27.5

And the problem should be resolved. 🙂