LaunchScreen Issues in Xcode - xcode

I am trying to design the Launch screen in XCode but facing one issue where I can't get any hint of how to resolve it. I am trying to build Xcode launch screen project but keep getting below error whenever I edit any of the LaunchScreen from Visual Studio.
Xamarin/Xamarin.h' file not found

I got it resolved, the issue was with image dimensions. Seems to be a bug where if you have image with too big dimensions it will cause your splash screen to go black. No build required on XCode side, when you update anything on story board it get reflect in VS project. So just want to share my experience if anyone face the same issue.

Related

SwiftUI Preview Canvas Build Fails but Project Build does Not

I am working on a project to add SwiftUI to a legacy app that uses Cocoapods. When I try to run the preview canvas the build fails and the canvas cannot run.
The cause is an issue building one of the included pods in the project (we’ll call this pod ‘LibraryX’). When XCode tries to build LibraryX it encounters a segmentation fault. But when I build the project itself there is no problem building LibraryX and starting the app.
I have tried looking for SwiftUI-preview-specific build settings in the XCode project build settings and have not been able to find anything. I have double checked the build path settings (as in this answer) and also verified that I am building on the correct device (as in this answer). In general, Googling for others who are facing similar issues has not turned up anything like my issue so far.
What I am wondering then is this: Does XCode use different build settings for building the project for use in creating the preview canvas? If so is there some way to configure how the preview canvas build works?
Because LibraryX is proprietary and the SwiftUI view I’m trying to add is simply the default “hello world” view that XCode creates there is not much I can share in the way of code samples for this question.
SwiftUI has still some bugs and is not perfect yet.
The canvas is part of SwiftUI and "shares" some of these bugs.
Sometimes you find yourself in a situation, where (a.) something does not work on Canvas or (b.) does not work correct on the simulator but (c.) works on a real device perfectly.
Most likely everything will get better over time, because SwiftUI is quite new (less then a year old) and Apple is pushing it.
My "solution" for the moment in similar situations is to not rely on canvas and just test on simulator.

Unity 5.3.1, I have deleted a splash image but it still exist somewhere and appears in beginning

I don't know if its a bug in unity 5.3.1 personal edition or I am doing something wrong.
I once put a splash image which appears fine in beginning but now I have removed it, even deleted it from project/asset folder. Now when creating new build for iPhone/xcode, I don't know how but unity brings the same old splash image every time. I have tried changing the image. but it still shows old one. Even in xcode I can surely see the new image everywhere but on device, its always old one.
I have tried cleaning xcode project and deleting app from device.
I know this is an old question but we ran into the same problem just recently.
he fix for this issue is to uninstall your project from the device and restart it.
This causes the device to delete the cached launch screens (yes, iOS caches all launch screens). When you install deploy your app now, it should use the new splash screen.

Storyboard Preview do not match simulator or device in xCode 6

I have been trying to figure this out for a long time now, either I am stupid, or Apple hav just made this really tricky. Storyboard Preview do not match simulator or device in xCode 6! I have added constraints so that the app looks just fine in all screen sizes in preview but it looks messed up when I run it in the simulator or on my device. help!
do you need any screenshots to answer my question?
I know other people have had the same issue but I can not find any answers.
The storyboard "Preview" doesn't match the simulator if you have any constraint errors/conflicts. I was having this problem, and found this question while searching for an answer.
Once I got all of the conflicts resolved, the Preview worked. It seems like the preview should consistently show what the simulator would show to help during the setup, but it's all out of whack if there are conflicts.
Using Xcode 6.3.1 and I was having the same problem(s). What I discovered is that you are missing constraints...
open main.storyboard in your "Structure" column you should see some red arrows, single click them and you should see what constraints you are missing.
Can confirm that this was resolved after taking care of all warnings and errors related to Auto Layout.
I just fixed my size class problem by having my constraints be set for compact width / regular height. When I set constraints specific to compact width / any height, it ignored my custom values.
Hope that helps. Took me forever to figure out because the description lead me to believe my custom layout would cover more devices with the latter choice.
Make sure you've got the latest xcode installed. I had the exact same problem before realising there was an update waiting. Now I've installed the update my preview matches what appears on the simulator.
How I got this fixed is by updating Xcode to the latest version. And then recreated the NIB/Storyboard files that were created using the previous version of Xcode. It started working. Weird fix :/
This is a constraints issue.
Some constraints are not set properly or not set at all. Once all constraint issues are resolved, you would see the simulator and preview matching exactly!
For anyone experiencing this issue in Xcode 8 and all all your constraints are in place (i.e. no warnings or errors) what solved it for me was quitting the simulator and restarting the app through Xcode again.

XCode project corruption

I've been working on an iOS project in XCode for a while now (XCode 4.4.1). This morning, I started up XCode (first time fresh for a while) and it started downloading an update. Once this was done, I noticed that most of my project was gone. All of my original files had been removed from the project. I checked the filesystem and they were still there.
I restored the project folder from Timemachine but the project was really confused and throught it was a MacOS project. So I created a new project and just copied my files into it.
That kinda of worked but now when my app runs it always runs in portrait mode even though I've set the project options to only run in landscape mode. In landscape mode, the text (and buttons and such) are all 90 degrees off. When I rotate the simulator the app does not respond.
I've set the storyboards to all run in both inferred and landscape orientation but neither worked.
Am I missing a project setting that will let my app work again?
Has anyone else suffered a project corruption like this?
I saw something like this when I migrated to iOS 6. I just bit the bullet and manually changed my MainWindow/RootViewController setup into a MainStoryboard. It worked out pretty well. Make sure you've disabled devil autolayout too.
Problem solved: I'm dumb.
The project was corrected so I rebuilt it. Being stupid, I changed the name of a couple of files (the view controllers) but forgot to update the storyboards. That's what happened when things go bung at 5AM.

Launch image doesn't update

I'm using Xcode 4.3.1. Adding launch image is pretty simple -- just drag the image to the Project->Summary->Launch Images window.
So I set a launch image before and it worked. But when I dragged a different image and run the app on my iPhone again, the launch image still remain the same as the old one. Even after I delete the launch image from the Launch Images window, the old image still shows up upon launching.
I've tried clearing the build as well. Didn't work.
Help please. Very much appreciated!
I had the same issue, but with launch storyboard. I had to rename the image I've used as a background.
Deleting from the device didn't help with Xcode 4.5.1. The build process is caching the image. With a hint from Zorayr's answer to related question "Xcode, can't remove “Launch image” from project," I decided to track the cached image down and destroy it, so it wouldn't keep being built and showing up in my test App.
Eventually, I found that Xcode (at least 4.5) builds the images by default in the following path off your home directory:
~/Library/Developer/Xcode/DerivedData/<ProjectName>-<uniqueID>/Build/Products/<Scheme>-iphone{os,simulator}/<ProjectName>.app/
So in addition to removing the old App image from the device (or simulator,) you also need to remove the image file(s) from the build cache. But just doing something like
rm ~/Library/Developer/Xcode/DerivedData/MyProject-fpwnjlbayydgzxcdlyrwxrwntapr/Build/Products/Debug-iphoneos/MyProject.app/Default*.png
won't always solve your problem. Instead, you might get a strange error in a popup window saying something like "Signed product moved or deleted." (I can't reproduce it right now to get the exact text.) It doesn't show up in the log file, and it just hangs the build process (in Xcode 4.5.1.) To get around that, I deleted all of the files under the <ProjectName>.app/ directory tree and the sibling directory tree <ProjectName>.app.dSYM/ containing (seemingly) the symbol tables and signature files for the parallel products. The build process will then re-create everything with no more complaints.
What worked for me on iOS 10.2.1, iPhone 5s hardware test device, Xcode 8.2.1
I think it has nothing to do with Xcode. The test device appears to be caching the LaunchScreen.storyboard image. I needed to reboot my device by holding home + top button. Then I rebuilt, low and behold, the image updated.
You should delete the app from the device, then launch it again.
Quit the simulator and then run the project again.
For device, as mentioned in other answers, delete the app from the device and then run the app again.
Steps that worked for me in 2020 (xCode Version 11.4.1):
Delete derived data
Restart xCode
Delete app on device
Restart device
Clean rebuild and run
Except the last step, I think the order doesn't matter.
It's really annoying though and I'm not even sure if it always works.
Pretty pathetic on apple's side. Good luck guys!
If you were using an asset catalog, it can also help to delete the images from the Images.xcassets file, and then load them manually in General>Launch Images.
This is what worked for me
Put the new image in project folder
Run app on device/simulator
Put image in xcassets under a different name
Run app again and it works
I thought I would create an update for anyone who is XCode 10 (and possibly XCode 9) and experiencing a blank black or white screen after modifying a launch image.
In my case I had to create launch images for the iPhone XR, iPhone X, iPhone XS and iPhone XS Max.
Originally I just had a sample white launch image for testing. After creating my proper image for the XR and replacing the sample the change would simply never show (on the XR device). I would still get a white screen.
I tried all of these in combination and failed:
-deleting the app beforehand.
-deleting xcode derived data and cleaning the build.
-restart Xcode and the device and the computer.
-deleting any existence of the white launch image on the computer.
-manually editing the JSON in a new images asset with the correct file names
The XR device would continuously show a white screen and after meddling with the build setting and migrating back to image packs it turned to black.
Solution:
Ultimately it started working after I also replaced the white 'XS' launch image with a new one as well. Even though the device is an XR. This is an odd solution but solutions like this have helped with launch images throughout the years.
For me, quitting the Simulator and restarting it worked -- I can finally see the updated launch image. The note above from Emil Korngold triggered me to try this.

Resources