jonbhanson / flutter_native_splash

Automatically generates native code for adding splash screens in Android and iOS. Customize with specific platform, background color and splash image.
https://pub.dev/packages/flutter_native_splash
MIT License
1.28k stars 200 forks source link

Incomplete removal of flutter_native_splash #683

Open PJPAC opened 1 month ago

PJPAC commented 1 month ago

Hi, I've been facing a side issue (get-it, BlocProvider and asynchronous registration leading to some classes not being "on time" registered), and with the aim of solving it, I have then been trying, with my limited understanding and experience, to allow for more resources to be allocated to singleton registration. For this reason, I have tried to uninstall flutter_native_splash from my project, and I failed. Any suggestion would be helpful.

Best Wishes

Describe the bug I've followed the command flutter pub run flutter_native_splash:remove First after having altered the pubspec.yaml file, and then after having realised it was both not working and a bit silly to have removed the reference to the dependency in the pubspec.yaml file,

Initially, I thought that I could remove the png file but then if the splashscreen were not show up any more, it would not mean that something is still not running in the background which would defeat the purpose of my efforts. To ;y surprise, when I have removed the png file from the assets, flutter clean, flutter pub get, restart the IDE, ... the splashscreen was still well alive.

Using Android Studio, and searching for the word "splash", it popped up as

in launch_background.xm files located in android/app/src/main/res/drawable-night-v21 android/app/src/main/res/drawable-night android/app/src/main/res/drawable-v21 android/app/src/main/res/drawable Similarly, there are references to a splash screen in styles.xml files located in android/app/src/main/res/values android/app/src/main/res/values-night ... etc. That said, I am wary of playing with these files as I would not really understand what I'd be doing...

I've noticed jantheok comment on the issue #553 but "reenable my platforms (by writting e.g. "Enable android for this project" in the command center" is unclear to me, especially "command center".

** A clear and concise description of what the bug is. The removal of flutter_native_splash as implemented through flutter pub run flutter_native_splash:remove and subsequent operations does not seem complete. Are there bits of codes somewhere which should be removed/edited ?

Configuration Android Studio Hedgehog | 2023.1.1 Patch 2 Flutter version 3.19.4 Dart version 3.3.2 DevTools version 2.31.1 Platform android-34, build-tools 34.0.0

** I use flutter_native_splash: ^2.4.0

Device (please complete the following information):

  • Device: Samsung Galaxy A70
  • OS: android 11

To Reproduce Steps to reproduce the behavior are given above.

Screenshots na

Additional context na

jonbhanson commented 1 month ago

Flutter comes with a blank white native splash screen. It cannot be removed. This package allows you to configure the splash screen. If you run the art run flutter_native_splash:remove command, it simply removes any customization that the package has made and restores the white splash screen.

If you are trying to free resources, removing this package will not help. This package does not consume any resources in your app beyond the storage space of any images that you have added.

PJPAC commented 1 month ago

Hi, Many thanks for the feedback. I take not for the resources.

I've rerun dart run flutter_native_splash:remove, after having reinstated flutter_native_splash in the dependencies + pub get, and before having commented it back + pub get... the previous splash screen still shows up at the start of the app. At the end of the day, it is not that annoying but it is puzzling.

lacodajeff commented 3 days ago

If you are having this issue on an ios simulator devices, try Device > Erase All Content and Settings... This worked for me. (after all the other remove steps)

PJPAC commented 1 day ago

Thanks for the feedback, I'm using my android phone rather than a simulator, but it might help someone else. Best Wishes.