Skip to content
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

Splash screen bug #18890

Closed
iamalexmang opened this issue Nov 19, 2023 · 6 comments
Closed

Splash screen bug #18890

iamalexmang opened this issue Nov 19, 2023 · 6 comments
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer platform/android 🤖 platform/iOS 🍎 s/needs-info Issue needs more info from the author t/bug Something isn't working

Comments

@iamalexmang
Copy link

Description

Hi,

I'm having issues related to changing a splash screen on my app.
Originally, I thought there was an issue with my SVG, but I then learnt that there might be something different to it. Specifically, no matter how many changes I applied to the same file, the same splash was always rendered.

Later, I realized that I should validate that the new splash screens are even considered by MAUI, so I decided to have new file names and based on this comment from thread #17940, I decided to re-run the application following this flow:

  1. I create a new splash and paste it in my project having a new name
  2. I close Visual Studio for Mac
  3. I delete the bin and obj folders
  4. I uninstall the app from my simulator
  5. I restart the simulator
  6. I reopen Visual Studio for Mac
  7. I rebuild and deploy the solution to the simulator
  8. I run the app

The bug is here: after days of frustration, I realized that SVGs I expected would show up, never show up (there's just a blank screen). What I later found is that if I apply the original svg (saved as splash1.svg), the splash shows up. Yet the exact same file content, called splash7.svg, once configured as my splash screen, doesn't show up. This is the exact same content (down by the character), but with a different name.

This suggests that the bug is rather in MAUI and has nothing to do with my file. Or there's something else I'm missing...

Steps to Reproduce

I'm providing these SVG files, virtually the same, but with different names.
splash1
splash7

This renders a blank screen:!

<MauiSplashScreen Include="Resources\Splash\splash7.svg" BaseSize="1179,2556" Color="#FFFFFF" />

This renders a logo screen:

<MauiSplashScreen Include="Resources\Splash\splash.svg" BaseSize="1179,2556" Color="#FFFFFF" />

Link to public reproduction project repository

No response

Version with bug

7.0.101

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

No response

Did you find any workaround?

Not yet

Relevant log output

No response

@iamalexmang iamalexmang added the t/bug Something isn't working label Nov 19, 2023
@davidortinau
Copy link
Contributor

https://learn.microsoft.com/en-us/dotnet/maui/user-interface/images/splashscreen?view=net-maui-8.0&tabs=android#set-the-base-size

I'm testing this with 8.0 on an M1 Mac using Xcode 15.0.

I think the black screen is related to xamarin/xamarin-macios#18469. Applying the workaround I see the SVGs, both of them.

<PropertyGroup>
	<EnableCodeSigning>true</EnableCodeSigning>
	<CodesignRequireProvisioningProfile>true</CodesignRequireProvisioningProfile>
	<DisableCodesignVerification>true</DisableCodesignVerification>
</PropertyGroup>

If I remove the base size altogether, OR if I set the base size to BaseSize="702.9,696.5", which is what I see in the svg for the viewport, then I get:

Simulator Screenshot - iPhone 15 Pro - 2023-11-19 at 18 29 06

I opened the SVG and noticed is had some hidden assets and it's an odd size even though the art is square. I removed the hidden art and resized the image to 300x300, also updating BaseSize="300,300":

Simulator Screenshot - iPhone 15 Pro - 2023-11-19 at 19 22 17

@jsuarezruiz jsuarezruiz added the area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer label Nov 20, 2023
@iamalexmang
Copy link
Author

I just tried to add the Codesign PropertyGroup in my csproj, but that didn't help. And unlike others who commented on #18469, I do have a Developer Account and valid codesigning keys configured.

This forced me to continue to check the SVG using Android, but the issues get even worse there.

To clarify, what I'm trying to achieve is to have the application logo in the middle and the company logo at the bottom (similar to what you see in with the Instagram or WhatsApp apps, with the Meta logo at the bottom, or Outlook/Excel/Word/Teams/PowerPoint and the Microsoft logo at the bottom).
Hence, logos won't be square.

The issue here is that if I use Android 11 to test the app, the SVG is way to large and despite explicitely configuring Resize="true", the logo is outside the screen bounds
image

On Android 12.1, the splash doesn't appear at all:
image

And finally, on Android 13, the splash is tiny and impossible to read:
image

In this regard, I'd argue that the MauiSplashScreen doesn't actually resize the splash screen as expected and the fact that the splash screen may or may not show up is counterintuitive.

@mattleibow
Copy link
Member

mattleibow commented Nov 20, 2023

Both issues are related to known changes by the platform:

I am not sure there is much we can do for Android as we have no way of changing this splash layout. The only way to move forward is to make all apps be a small, centered splash.

Let me know if this helps because I think that until Google changes something this is the way it will work.

@mattleibow mattleibow added the s/needs-info Issue needs more info from the author label Nov 20, 2023
@ghost
Copy link

ghost commented Nov 20, 2023

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

@davidortinau
Copy link
Contributor

@iamalexmang you can also disable the MAUI splash generation and make your own using the platform methods. As the last line of that splash screen documentation says "For more advanced splash screen scenarios, per-platform approaches apply."

These older Xamarin docs may be helpful if you need a refresher on how the platforms work, and you can refer to Apple and Google's docs directly for the latest guidance. In .NET MAUI implement this in the Platforms folder.

@ghost ghost added the s/no-recent-activity Issue has had no recent activity label Nov 24, 2023
@ghost
Copy link

ghost commented Nov 24, 2023

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

@ghost ghost closed this as completed Nov 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 28, 2023
@ghost ghost removed the s/no-recent-activity Issue has had no recent activity label Dec 28, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer platform/android 🤖 platform/iOS 🍎 s/needs-info Issue needs more info from the author t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants