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
34.87k stars 5.59k forks source link

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

Open jaworskimatt opened 1 month ago

jaworskimatt commented 1 month 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 1 month ago

same, it's working in Debug mode tho.

rsoaresdev commented 1 month 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 1 month ago

I have the same problem with bare workflow...

vsundar17697 commented 1 month ago

I'm having the same issue as well !

hernanhawryluk commented 1 month ago

I’m experiencing the same problem.

rsoaresdev commented 1 month ago

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

hernanhawryluk commented 1 month ago

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

bytemtek commented 1 month ago

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

rsoaresdev commented 1 month 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 1 month 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 1 month 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. 🙂

SanjayDevTech commented 1 week ago

@jaworskimatt hey the latest version is 0.29.9, can you check is this fixed?

mikerogerz commented 1 week ago

@SanjayDevTech @jaworskimatt Tested on 0.29.10 and same issue. The only fix was to downgrade to 0.27.5.

ollyde commented 1 week ago

I'm seeing this issue as well on bare project, very annoying for dev. Using 0.27.5 and 0.29.11 :-/

juan-vilas commented 1 week ago

Tested in 0.27.5 but still not working with SDK 52

david-bermejo commented 6 days ago

Same problem here, still not working with 0.29.12 and SDK 52

juan-vilas commented 6 days ago

In the mean time I'm using https://github.com/zoontek/react-native-bootsplash It works perfectly!

RyanMG commented 3 days ago

I was having no splash screen issues when developing under Expo 51 / expo-splash-screen 0.27.5, as above. When I bumped to Expo 52 I had to take expo splash along for the ride. It has not worked properly since.