maui
maui copied to clipboard
Splash Screen does not update iOS
Description
When changing the splashscreen (or icon), the changes are visible on both Android and iOS simulators, but when deployed to a physical device, it shows the original purple background with .NET in the centre.
I believe with the android device, there is another issue related to the icon being displayed instead of the splash screen, so the reproduction code was more for testing iOS then android. This is a known issue with the android version, so it was not tested
.NET Version: 6.0.400-preview22301.10 VS Pro Version: 17.3.0 Preview 2.0
Repro Code: https://github.com/camgra/maui-test-app
Steps to Reproduce
- Create a new .NET MAUI Blazor application
- Replace the content of
splash.svgwith another image. (I used a text editor to do this) - Update the .csproj file, replacing the
BaseSizevalue with256,64 - Run the project on a simulator. I used an iPhone 13 Pro, 15.5.
- Note the splash screen has been changed
- Run the project on a device - I am using an iPhone 12 Pro, 15.5 for this. It is directly connected to Windows with Hot Reload, but it is paired to a Mac
- Note the splash screen remains with the stock ".NET" item.
Not sure if it is related or not, but I found that in order to run the app on a physical iOS device, I had to add an Entitlements.plist to the project. I didn't see this documented anywhere, but I am only noting it here as it is different from the template
In another project, the same thing is happening with the icon which works with the simulator, but not with the physical device. I believe this has already been reported.... but I assume they are related. The repro code does not have the icon changed
Version with bug
Unknown/Other (please specify)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 15.5
Did you find any workaround?
No workaround at this time
Relevant log output
No response
For me it happened that if I had an old app with the same name, it keeps running the old app or some of its parts
Definitely there is some caching going on with this sometimes. Would you be able to confirm if you do a clean, rebuild, maybe delete your bin & obj folders and delete the app from the device if it was installed before? Does that help at all?
Hi @camgra. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
@jfversluis, I tried several combinations of this before with no success. I also remove the solution from my PC and pulled it down from source control as well (since the bin and obj files are not included in the repo).
I ran it again on the simulator and confirmed that the splash screen was updated, and then tried on the physical device (iPhone) and it showed the original .NET splash screen.
It also crashed with the following (on the physical device only):
**System.Exception:** 'Could not find a .content folder in the app directory: /var/containers/Bundle/Application/6C321DA5-B789-41AD-8BE6-3E1922918ED2/MauiApp1.app'. I don't know if that is related or not, but it is new since pulling and rebuilding it.
Just to rule out the iPhone I use for testing, I also provisioned an iPad that has not been used before for development and deployed the app to that. This test produced the same result as the iPhone, with the old splash screen and same system exception.
I have the same issue. No matter what I tried the Splash and App icon will not update on the directly connected iPhone. Android works fine. I have deleted the bin/Obj folders, did a solution clean, removed app from iPhone and reset iPhone. Still the .NET logo and background are shown.
I have the same issue. Here is what I found out
- I have this issue on both ios emulator and iPhone. Not android (or at least it fixes itself much faster so i didn’t notice)
- It could be relared to this old issue on Apple forum https://developer.apple.com/forums/thread/68244
- I uninstalled Visual Studio, all versions of dotnet. Deleted all the temp directoreis i could find, reinstalled all from scratch and still no luck.
Workaround that i found that usually works is this
- delete app from device/emulator and clear all data
- clean solution
- reboot device/emulator (this step is important)
- build and deploy app
The workaround works while developing but will probably not work on customers devices if the splash screen gets updated between versions. Unless they delete their app and data from the phone and reboot.
I run VS 17.3 on Windows 11 with the version of maui that came with it. Didn’t test on other dev setups
Not sure what we can do here. The OS seems to not want to update the images. The obj and app package has the new images.
@dalexsoto is there any special thing that maybe the deployment can do? Like a --reset-icon-cache-baby-please? :)
if you will change name for svg file it will be changed
Interesting... I wonder if it is caching the storyboard file and detect no change when changing the image. And the filename happens to update the xml.
I can try adding a dynamic comment to the storyboard to see...
Or maybe the renamed image invalidates the image cache...
Also if you will change svg file and will not chage the name, you will have mess with old and new icons. also this is happend for Azure Pipline, so it's soooo strange.
Is this on the same device? If you install the app onto a new device is the icon correct?
@mattleibow nope. Old iPad 7 generation and iPhone 13 max pro have different images.
sometimes on iPad all is ok, but on iPhone I see old icon. Or iPad is broken but iPhone is fine.
Does it give the correct values if you uninstall and then reboot the device?
Does it give the correct values if you uninstall and then reboot the device?
I build it on Azure Devon’s pipeline and install it from TestFlight, but when I will change name of file then all gone be fine.
so I will try it
okays... so after a time that is too long to be happy about, I suddenly saw something... the OP was saying that they are using iOS hot restart (ios device attached to windows) and unfortunately the special app we use for that does not support changing the icon and splash screen. This is because the app is actually pre-built and using default assets.
I have started a discussion to either get dynamic asset support or at least change the default icon/splash to be different to the default template app so everyone knows it is special.
However, this does not do away with build agents and mac things not working.
Now I got some interesting things with the icon, it does not change on the device... but it does actually. I have the old image on the start screen, but when you open/close it, the zoom animation uses the new image. I tried using a new image file and I get the same result.
After uninstalling the app and re-deploying it worked.
https://user-images.githubusercontent.com/1096616/195175538-fab7ee28-01d8-4aa2-a3fc-439a9b76a4b7.mov
Doing some more testing on my simulator now and things are not looking great. When you change the image name it seems to work because it has a new image to cache. I had an app that had splash1 and splash2, but I used splash1. When I switched to splash2 AND changed the color, it seemed to switch to splash2, but used the OLD color of splash2.
Something is being cached. If I reset the sim then it worked.
I bet when you say "but when I will change name of file then all gone be fine." you are using a totally new filename? I wonder what happens if you you a slightly older filename?
@mattleibow these stuff used to happen for me also when the android package name (com.me.myapp etc) was the same, the phone might have cached it as well or something I was thinking (android)
I'm also having this issue. I've renamed the svg's and uninstalled and reinstalled with no luck. When I hold the icon down it doesn't update. My splash screen is also the .NET default despite having changed it in code. Everything works fine when I deploy to both my android phone and the android simulator.
Have you tried ubinstalling the app and rebooting the iPhone. Or resetting the simulator?
I did try uninstalling, then rebooting. I can try it again, I'm using the hot reload function from windows with the iPhone directly connected to my computer. I've also updated to the newest non-preview release and updated to the newest windows 11 public release as well in the event it was something weird with either of those. I'll try uninstalling and rebooting then redeploying again and report back. When I changed the name, I just put the developer name in-front of the SVG names assuming that was enough as well.
Ok, I just uninstalled, rebooted and redeployed and had the same issue. I also did an uninstall, reboot, clean solution, rebuild solution, redeploy with the same issue as well. This is on IOS 16.0.2 and 16.0.3 (I've upgraded to the latest security release since first attempting to resolve) on an Iphone 12 pro, if that makes any difference at all.
Ah, this issue has devolved into so many side issues... But, the direct ios on windows feature does not support cuson splash screens and icons at the moment due to the way things are handled in the iOS-windows system
https://github.com/dotnet/maui/issues/8685#issuecomment-1274647794
If you are using the iPhone on macos, this seems to be some caching issue and we are trying to see what is causing this as it appears xcode somehow invalidates the cache.
good to know, thank you!
finally I can test it :) I will do this on real device, so I will change icon content widouth name, and will build it on AzurePipline, push it into TestFlight and check on my iPhone and iPad
now I can confirm. I used "old" name for file. just change content
-
- iPad after update app from TestFlight displayed right icon.
-
- iPhone is not. 2.1. After update app from TEstFlight I saw old icon. 2.2. I delet app and install it again - old icon. 2.3. I deleted app, restart phone, install app from TestFlight and then I will have new icon
So, maybe we can generate unique name every build time? Like guid?
I will test on xcode and see. I hear rumors that it does not have this issue and this makes me very scared.
If this still is the case, I will investigate some guid thing.
But thank you so much for the confirmation of the issue.
I can reproduce this in Xcode as well. @davidortinau what did you do to get it to work? If I clean, build, uninstall the app, it still remains the old one.
If I uninstall and reboot, then it changes...
Seems to be a thing: https://stackoverflow.com/questions/35192425/ios-launch-screen-does-not-update
Created a testing Xcode repo here: https://github.com/mattleibow/TestingLaunchScreen
https://user-images.githubusercontent.com/1096616/196297274-fee9b135-2cc9-4e54-9a3a-e6a5732b5bd5.mov