Xamarin-macios: [Bug] iOS 14 Launch Screen is not working

Created on 24 Sep 2020  Â·  18Comments  Â·  Source: xamarin/xamarin-macios

Description

iOS 14 Launch Screen with image is not working. Works fine on iOS 13.7. If I remove image and set a background color, Launch screen will show the background color. If I set an image, neither the background color or image shows. Issue can been seen on both simulator and device.

It also looks like Apple has changed Launch Screen functionality with iOS 14. It mentions old method should still work. We cannot switch to the new method and leave version earlier than iOS 14 behind.

https://useyourloaf.com/blog/dropping-launch-storyboards/

Steps to Reproduce

  1. Update device to iOS 14. Update Xcode to 12.
  2. Create Launchscreen.storyboard with an image
  3. Set info.plist Launch Screen to Launchscreen storyboard above

Expected Behavior

Launch Screen with image to display in iOS 14 like it does on iOS 13.7

Actual Behavior

Black Launch Screen

Basic Information

  • Version with issue: iOS 14, Xcode 12
  • Last known good version: iOS 13.7, Xcode 11
  • IDE: Visual Studio 2019
  • Platform Target Frameworks:

    • iOS: iOS 14

Workaround

  • Not using an image in Launchscreen storyboard

  • Use image outside of Asset Catalog. Make sure image is not large in size, if your image is not working try a smaller image and work your way up.

iOS need-info

Most helpful comment

@chamons Thanks, your solution worked.

Yes, this looks like a iOS 14 issue. Use image outside of Asset Catalog. Make sure image is not larger than 2400px.

All 18 comments

Same issue here. We have multiple targets/schemes and some kept on working. So I checked all target memberships and both the launch screen (linked to all targets) as well as the image on it (linked to specific target) seems to be ok.

Thank you for your feedback!

For us to investigate this further, could you please provide a small sample showing the specific issue? Project plist configurations can change behavior significantly.

We look forward to hearing from you!

It's the same entry for all targets:

UILaunchStoryboardName
Launch Screen

screen1
screen4
screen3
screen2

I tried a small sample app against Xcode 11.7 and Xcode 12:

AppWithLaunch.zip

I can not reproduce your issue. Please attach a sample showing the behavior in question.

I am using Xamarin Forms but same issue is for me too. After launch screen app shows black screen.

@kerbooo - Please attach a sample project showing the issue. This is current in need-info as I am not able to reproduce it. Without that, or more details so i can, this issue will be closed.

I also have this problem, please do not close issue without doing anything, problem really exists.

Hello everyone I have solved this problem fixing Info.plist

7 Eki 2020 Çar 11:26 tarihinde Armen notifications@github.com şunu yazdı:

I also have this problem, please do not close issue without doing
anything, problem really exists.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/xamarin/xamarin-macios/issues/9764#issuecomment-704778780,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACWWPUCJOKFH6SYNWHLLQPTSJQQ3JANCNFSM4SA5HTYQ
.

@kerbooo what did you have to "fix" in Info.plist?

@chamons I'm also experiencing the issue on a 2.5 year old Xamarin.Forms project. The only thing that changed was updating to Xcode 12. It's definitely broken, and definitely a Xamarin-specific issue.

Additionally, while attempting to generate a project for you guys since the project I'm working on is proprietary, I get this error when opening the brand new project's storyboard in Xcode. So that's a non-starter.

image

So ok, whatever... I'll deal with the awful built-in iOS Designer. Open that up and I see a blue field and what looks to be a poorly positioned image reference that can't be found.

image

Inspecting the source, it looks to be a reference to one of the app icons. Launching the app in the simulator shows a blue field, but no image.

So this is better than flat black, which is what my existing app shows, but it's still broken in a rather odd way. At the very least, the sample projects, which I've attached with no modification, are broken.
test.zip

Thanks for the test project @ianthetechie !

I'll take a look shortly, and see if I can reproduce what you are seeing locally.

I do not believe this is a Xamarin.iOS bug, but a behavior change from Apple.

Here's the detail. As described here:

https://developer.apple.com/forums/thread/19759

It seems that assets in Assets.xcassets are not accessible in time for the launch screen anymore on iOS.

If I copy an image out of it, and include it directly:
test2_copy_image.zip
or if i use a system image:
test2-system_image.zip
it works just fine.

Given that other folks are seeing this as well, and are not using Xamarin, I'm going to close this as "Apple behavior change".

Please reopen if you have reasons to believe that somehow this is Xamarin specific.

@chamons please look at this example with larger image...
test.zip

@Legolas87 - I believe the problem is the 9 meg image you tried to load as a png. I converted it to a small jpg and it works on my device. I've had difficulties getting any launch screen to show on simulator.

Here is the project:
test2.zip

@chamons Thanks, your solution worked.

Yes, this looks like a iOS 14 issue. Use image outside of Asset Catalog. Make sure image is not larger than 2400px.

We use three pdf images in our code. Two are way too large indeed and when I remove or resize them it works as expected.
Putting them outside xcassets is not really necessary. You have to restart your device to have new images in xcassets for launch screens to have effect.

I had the same problem, just one view with one image (jpg 2732x2048 px), always worked fine, now showing black screen. Solved it as below, did not resize the image file.
I assigned a non-existing image to the UIImageView then launched App. Then reselected my original imagefile (.jpg) and ran app again and now all is working as before. I did not have to reduce the size.

I have been struggling with this for an entire day....
What did the trick for me was to uninstall the app and restart the phone.
After that my launch screen showed just fine!

look this https://useyourloaf.com/blog/dropping-launch-storyboards/ with the new UILauchScreen the UILaunchStoryboardName on iOs 14 doesn't work

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iulian-mirica picture iulian-mirica  Â·  3Comments

parmjitv picture parmjitv  Â·  4Comments

orryverducci picture orryverducci  Â·  4Comments

whitneyschmidt picture whitneyschmidt  Â·  3Comments

nickplee picture nickplee  Â·  3Comments