-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App doesn't delete cached LaunchImage and creates un ugly flickering btw the old cached and the new LaunchImage #55952
Comments
Hi @tomasbaran |
Sure, as I say above—just use the default app that comes with Flutter. But it doesn't matter it can be any code... But I can copy it for you. Here is the lib/main.dart 1. Code Sample
|
Hi @tomasbaran import UIKit
public extension UIApplication {
func clearLaunchScreenCache() {
do {
try FileManager.default.removeItem(atPath: NSHomeDirectory()+"/Library/SplashBoard")
} catch {
print("Failed to delete launch screen cache: \(error)")
}
}
} Please see https://flutter.dev/community for resources and asking questions like this, |
Thank you for giving me an answer @iapicca, however, you didn't tell me anything I wouldn't already know. Everything you answered I explained in my issue, including the link and the code you provided. If you read my issue thoroughly I even explained that it's not originally the Flutter issue, however, this issue concerns the Flutter apps too. This iOS bug makes it even a bigger bug for Flutter since Xcode doesn't come up with any default LaunchImage but Flutter does (the white one), so therefore after the first launch of Flutter it caches a LaunchedImage which you can't clear. With that being said, I think Flutter can prevent inheriting this iOS issue. That's why I reported it. Maybe just by including the lines created by Rambo (https://rambo.codes/posts/2019-12-09-clearing-your-apps-launch-screen-cache-on-ios) in the iOS folder in the Flutter default folder. Or at least by commenting them in the AppDelegate (I guess since I'm not a Swift developer). |
I can't reproduce it with current master flutter doctor -v
@tomasbaran can you confirm is it fixed? |
Wow! What is that some kind of a magic? :) No one tried to fix this issue and it got fixed by itself? :D It seems to be fixed, man @VladyslavBondarenko :) I couldn't believe it! :) but you are right I couldn't reproduce this issue any more either. heh flutter doctor -v
|
There could be a duplicate issue, which was fixed in some version in between, I'm not aware. And I didn't try other channels. Closing then if it's working as intended with the latest version |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Demo
You can see flickering between the old (still cached original LaunchImage) of purple color and the new LaunchImage (the only one that should have been shown as a LaunchImage) of pink color
Steps to Reproduce
Expected results:
It should only show me the red LaunchImage
Actual results:
Ugly flickering/flash from the 1. original white LaunchImage -> 2. the new red LaunchImage screen
** More Details **
I know that it's not Flutter's issue but iOS's issue because iOS doesn't delete the old cached LaunchImage. But I believe that Flutter doesn't have to inherit iOS's bugs, we can do better that than and can even avoid iOS native bugs.
I even found some solutions but since I'm not a Swift developer, I cannot implement them even though they seem very simple to implement.
https://rambo.codes/posts/2019-12-09-clearing-your-apps-launch-screen-cache-on-ios
https://stackoverflow.com/questions/33002829/ios-keeping-old-launch-screen-and-app-icon-after-update
I would appreciate anyone familiar with Swift maybe in the meantime to share how to fix it in Swift or where exactly (on what line number and in which file) to call the clearLaunchScreenCache() function.
Logs
The text was updated successfully, but these errors were encountered: