maui icon indicating copy to clipboard operation
maui copied to clipboard

Splash Screen does not update iOS

Open camgra opened this issue 3 years ago • 47 comments

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

  1. Create a new .NET MAUI Blazor application
  2. Replace the content of splash.svg with another image. (I used a text editor to do this)
  3. Update the .csproj file, replacing the BaseSize value with 256,64
  4. Run the project on a simulator. I used an iPhone 13 Pro, 15.5.
  5. Note the splash screen has been changed
  6. 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
  7. 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

camgra avatar Jul 12 '22 17:07 camgra

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

janseris avatar Jul 12 '22 18:07 janseris

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?

jfversluis avatar Jul 14 '22 13:07 jfversluis

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.

ghost avatar Jul 14 '22 13:07 ghost

@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.

camgra avatar Jul 15 '22 11:07 camgra

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.

SenexTech avatar Jul 19 '22 22:07 SenexTech

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

kajetan-kazimierczak avatar Aug 13 '22 23:08 kajetan-kazimierczak

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? :)

mattleibow avatar Oct 07 '22 11:10 mattleibow

if you will change name for svg file it will be changed

KSemenenko avatar Oct 07 '22 12:10 KSemenenko

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...

mattleibow avatar Oct 09 '22 07:10 mattleibow

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.

KSemenenko avatar Oct 09 '22 10:10 KSemenenko

Is this on the same device? If you install the app onto a new device is the icon correct?

mattleibow avatar Oct 09 '22 10:10 mattleibow

@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.

KSemenenko avatar Oct 09 '22 11:10 KSemenenko

Does it give the correct values if you uninstall and then reboot the device?

mattleibow avatar Oct 09 '22 11:10 mattleibow

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

KSemenenko avatar Oct 09 '22 12:10 KSemenenko

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.

mattleibow avatar Oct 11 '22 12:10 mattleibow

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

mattleibow avatar Oct 11 '22 18:10 mattleibow

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 avatar Oct 11 '22 20:10 mattleibow

@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)

janseris avatar Oct 11 '22 20:10 janseris

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.

ebaldwin1 avatar Oct 12 '22 15:10 ebaldwin1

Have you tried ubinstalling the app and rebooting the iPhone. Or resetting the simulator?

mattleibow avatar Oct 12 '22 18:10 mattleibow

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.

ebaldwin1 avatar Oct 12 '22 23:10 ebaldwin1

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.

ebaldwin1 avatar Oct 12 '22 23:10 ebaldwin1

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

mattleibow avatar Oct 13 '22 00:10 mattleibow

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.

mattleibow avatar Oct 13 '22 00:10 mattleibow

good to know, thank you!

ebaldwin1 avatar Oct 13 '22 12:10 ebaldwin1

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

KSemenenko avatar Oct 13 '22 13:10 KSemenenko

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

KSemenenko avatar Oct 13 '22 14:10 KSemenenko

So, maybe we can generate unique name every build time? Like guid?

KSemenenko avatar Oct 13 '22 20:10 KSemenenko

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.

mattleibow avatar Oct 14 '22 18:10 mattleibow

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

mattleibow avatar Oct 17 '22 22:10 mattleibow