iOS Keeping old launch screen and app icon after update

Ios

Ios Problem Overview


I have an app where I recently replaced the launch images and app icons, I removed all of the old assets from everywhere in the project. When I upgrade the app from the old version to the new version by just building in Xcode, everything is fine. However, if I have the old version of my app installed then upgrade it from TestFlight, every time I kill the app then restart it the old launch image briefly appears before showing the new launch image. Similarly when I then close the app, the old app icon briefly flashes before switching back to my new one.

I opened up the App using iExplorer and noticed that there is an image of the old launch screen saved in the /Library/Caches/Shapshots directory (I don't know how or why it got there). When I delete it manually through iExplorer, it stops appearing. However, when I try to remove it with code using NSFileManager methods, I get errors saying I am forbidden from deleting files in this directory.

Has anyone experienced this before and have any advice?

Ios Solutions


Solution 1 - Ios

I have been able to reliably get the springboard cache cleared for testing launch image changes by doing this:

  1. Delete your app from the device
  2. Power down the device
  3. Power up device, install and launch app.

The image updates properly every time. Shame I need to power down the device to get it to go - but at least I have been able to make progress this way. I hope this helps someone.

> In case of the simulator, just restarting of simulator should work.

Solution 2 - Ios

These caches are used by Springboard to make app switching fast. This isn't a problem that will affect your production users and should in theory go away the next time Springboard decides to snapshot your app.

That being said, this isn't a problem you can fix. This is a bug in Apple's code not yours.

UPDATE: There appears to be a work around that doesn't require restarting the device.

This will take effect after the second launch!

do {
   try FileManager.default.removeItem(atPath: NSHomeDirectory()+"/Library/SplashBoard")
} catch {
   print("Failed to delete launch screen cache: \(error)")
}

A full explanation of how that works here: https://www.rambo.codes/posts/2019-12-09-clearing-your-apps-launch-screen-cache-on-ios

Solution 3 - Ios

For the simulator just Reset Contents and Settings...

Solution 4 - Ios

This worked for me: http://arsenkin.com/launch_screen_image_cache.html

> Again, thanks to the thread I have referenced above I found a way to > solve this issue - name your new image differently from the one there > was before in case your new one has the same name as the old one and > put it out of the *.xcassets folder to the project directory and > reference it in your UIImageView. And that's it. Sound stupid easy but > oh gawd how much rage I had.

Solution 5 - Ios

Uninstall your app, restart your phone and install your app again... This actually fixed in my case.

Solution 6 - Ios

I found workaround solution what if you really want to fix this issue. Apple have some mechanisms to cache images of launch screen which indexing by image file name.

When you change any images on launch screen and you want to see those change in next run immediately. please using new image name which image you changed and link to new image file in storyboard or xib.

Run again, you will see new change appear.

Solution 7 - Ios

What worked for me:

  • Deleting the LaunchScreen's Scene and View Controller and create a new one (make sure you set it as "Initial View Controller" in the Attributes Inspector).

What did not work for me:

  • Deleting the app
  • Restarting the iPhone, Mac or Xcode
  • Deleting Derived Data
  • Deleting the device's container
  • Cleaning
  • Burning 3 Steve Jobs Voodoo dolls
Note:

> Sometimes erasing (simulator) is needed too

Solution 8 - Ios

I also faced the same issue. It happens because the simulator/ iOS device caches the launch image when you first launch the application. I added some modifications to Brian Trzupek's answer:

  1. Delete the image set from Xcode assets (eg. launch_image)
  2. Add a new image set and add images to it.
  3. Switch off and switch on the iOS Device. (Reset Contents and Settings for simulator).
  4. Clean the Xcode build folder (Press command + option + shift + K).
  5. Delete the app from the device/simulator (if available).
  6. Run again.

Solution 9 - Ios

Honestly, I didn't take the risk to go live without being sure if this will be updated or not.

So, assuming you are using xcassets, a simple solution is:

> 1. Delete the old image set > 2. Recreate one with a different name and add your splash screen images > 3. Update your storyboard to use this 'new' image set reference

It will update for sure ! (I even tested with app already installed on the device). No need to clean cache of device or so.

Solution 10 - Ios

Just connect your device, go to Xcode > Window > Devices > Your device, now in installed apps, select your app, right click and download container, go to the generated file, right click, Show package contents, AppData, Library, Caches, and delete files. Now go to Xcode > Window > Devices > Your device > your app and right click to replace containers.

Solution 11 - Ios

  1. Delete your app from the device
  2. Power down the device
  3. Power up device
  4. Install and launch app.

Solution 12 - Ios

Solution Work For Me

  1. Delete your app from the device
  2. Switch off device
  3. Switch on device
  4. clean Build Folder
  5. Again build and install and launch app.

Enjoy

Solution 13 - Ios

Xcode 10/iOS 12

After trying all the things mentioned above, I had to delete the imageview from the LaunchScreen and replace it with a new one.

Solution 14 - Ios

> This worked for me: http://arsenkin.com/launch_screen_image_cache.html > > Again, thanks to the thread I have referenced above I found a way to > solve this issue - name your new image differently from the one there > was before in case your new one has the same name as the old one and > put it out of the *.xcassets folder to the project directory and > reference it in your UIImageView. And that's it. Sound stupid easy but > oh gawd how much rage I had.

I can confirm that @JERC worked and thanks to arsenkin

In my case I work on a react native project and had a .storyboard file in ios/projectname I just want to replace the old image with the same size and keep the old constraints. I didn't want the user to delete the app or restart their phone.

WHAT I DID

  1. Copy the image to the project src (in my case I put mine in src/assets).
  2. Open finder and drag the image to xcode project in to the project directory.
  3. There will be a popup make sure you create a reference to the project. here
  4. Change the image src in .storyboard to the referenced image. here
  5. Clean build folder. here
  6. Rebuild app

Solution 15 - Ios

Ok, so I figured out the issue. In the previous version of my app, we were using a Launch Screen XIB. Somewhere in the development of this new version, the xib was deleted and replaced only with static launch images.

The solution is to use a Launch Screen XIB. I noticed that the moment I used a launch screen xib for the first time, the file stored in the snapshots directory was replaced with the snapshot of the xib.

Solution 16 - Ios

This is the fastest way I found to resolve this issue although it sounds stupid:

  1. Right click on LaunchScreen.xibor on your launchscreen file and select Remove file then select Remove to trash. This will remove all references of the file and its past updates from your project.

  2. Go into your trash and drag and drop the file back into your xCode project (within yourProjectName).

  3. Clean and rebuild.

Solution 17 - Ios

Use this piece of code to clean launch screen cache:

import UIKit

public extension UIApplication {
    func clearLaunchScreenCache() {
        #if DEBUG
        do {
            let launchScreenPath = "\(NSHomeDirectory())/Library/SplashBoard"
            try FileManager.default.removeItem(atPath: launchScreenPath)
        } catch {
            print("Failed to delete launch screen cache - \(error)")
        }
        #endif
    }
}

Usage:

UIApplication.shared.clearLaunchScreenCache()

Solution 18 - Ios

Make sure you did all these steps

  1. Search for ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME key in build setting and search its assets value in entire application then remove it.
  2. Delete ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME from Build setting.
  3. Create New Launch screen Xcode -> File -> New -> File -> Launch Screen
  4. Goto App main Target -> General -> App Icons and Launch Images -> Launch Screen File -> Choose the New Launch Screen File.
  5. If you just changing the old Launch screen, try naming the new assets with different names.

Solution 19 - Ios

For Simulator Or For Real Device You just need to follow these steps.

  1. remove you splash from xc assets.
  2. drag and drop png or jpg file into Root.
  3. LaunchScreen.xib or storyboard. open ViewController and set ImageView ref that particular image which you dragged.

If you don't have ViewController and using old version react you will just found there named as View. so remove that and make new ViewController in case if that View doesn't show your Splash.

Solution 20 - Ios

Had this problem also. Being a total novice I naively changed the LaunchScreen.storyboard to LaunchScreen.xib. The run failed (duh), so I changed it back to .storyboard re-ran the app just to test I'd not screwed anything else up - and the old screen didn't appear first. So whatever I did, it must have flushed out the old cache.

Solution 21 - Ios

Had same problem but only with image used in launchscreen storyboard. Moving the image from the asset catalog changing its' name to the app bundle (for example, old image set in asset catalog was called launch_logo, and image in app bundle is called launchscreen_logo.png) solved the issue for us.

Solution 22 - Ios

I guess these are depended on situations. When It happens at debug or testing, works on deleting image on launch screen. Or uninstalling your apps, then restart launch.

But It goes even after archive, then It doesn't solve with reset and clean.

Solution 23 - Ios

In my case, I haven't selected App Icons Source From App Setting -> General -> App Icons and Launch Images -> App Icons Source

enter image description here

Solution 24 - Ios

Try it in AppDelegate

    if #available(iOS 13.0, *) {
        do {
            try FileManager.default.removeItem(atPath: NSHomeDirectory()+"/Library/SplashBoard")
        } catch {
            print("Failed to delete launch screen cache: \(error)")
        }
    } else {
        print("ios is min")
    }
    

Solution 25 - Ios

Inspired by Guilherme Rambo's blog entry, I've created a cordova-plugin to programmatically purge the launch screen cache on iOS 13+:

cordova.plugins.launchScreenCache.deleteLaunchScreenCache().finally((result) => {
    // returns true in the success case, false if iOS <13
    // rejects in an error case
});

More information can be found on the GitHub repo

Solution 26 - Ios

First of all

> Clean & Build project

Method 1:
Rename the Splash image loaded in LaunchScreen.storyboard.

For example, I loaded "splash" but changed it to "splashNew".

Method 2:

Run your app on a different device or emulator

For example, if you run app in a emulator iphone 11 run it into iphone 12

Solution 27 - Ios

Try opening the simulator, going to Hardware -> Erase All Content and Settings.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionlramirez135View Question on Stackoverflow
Solution 1 - IosBrian TrzupekView Answer on Stackoverflow
Solution 2 - IosInkGolemView Answer on Stackoverflow
Solution 3 - IosMurray SagalView Answer on Stackoverflow
Solution 4 - IosJERCView Answer on Stackoverflow
Solution 5 - IosAnkit PundhirView Answer on Stackoverflow
Solution 6 - IosYu-Sen HanView Answer on Stackoverflow
Solution 7 - IosDaniel SpringerView Answer on Stackoverflow
Solution 8 - IosAlvin GeorgeView Answer on Stackoverflow
Solution 9 - IoshicoView Answer on Stackoverflow
Solution 10 - Iosuser6312715View Answer on Stackoverflow
Solution 11 - IosJone RenView Answer on Stackoverflow
Solution 12 - IosM MurtezaView Answer on Stackoverflow
Solution 13 - IosahbouView Answer on Stackoverflow
Solution 14 - IosSorakris ChaladlamsakulView Answer on Stackoverflow
Solution 15 - Ioslramirez135View Answer on Stackoverflow
Solution 16 - IosWalter MoneckeView Answer on Stackoverflow
Solution 17 - IosMor4ezaView Answer on Stackoverflow
Solution 18 - Iosjeff ayanView Answer on Stackoverflow
Solution 19 - IosSyed Moamber RazaView Answer on Stackoverflow
Solution 20 - Iosrichard s. hillView Answer on Stackoverflow
Solution 21 - IosAnton FilimonovView Answer on Stackoverflow
Solution 22 - Ios이혜린View Answer on Stackoverflow
Solution 23 - IosMehrdadView Answer on Stackoverflow
Solution 24 - IosramazanDevView Answer on Stackoverflow
Solution 25 - Iostimbru31View Answer on Stackoverflow
Solution 26 - IosMoustaoui SalaheddineView Answer on Stackoverflow
Solution 27 - IosTigran IskandaryanView Answer on Stackoverflow