Cannot run program in Xcode - ios

I've recently made an app and could successfully run and test it until this suddenly happened,
fail to run program
It doesn't looks like an issue, but the "run" button is unavailable. Usually it should look something like,
successfully run a program
As in the image, first there are two buttons, run and stop, after that there is the name of the program/app and its icon (fun facts) and then the iphone simulator it will run on (iphone 6). On the image on top, the failed to run program attempt, it is totally different, first the run button is disabled, second, the icon is a gear and not the app icon, and third, there is no simulator, it appears "my mac".
I don't know why this happened but this cannot let me run the app. I searched in the apple documentation and didn't found anything. If someone knows how to solve this please tell me.

The simplest solution is to rebuild your project from scratch. This is not difficult because you still have all your code. So, start with a new project from the iOS template. Copy your code from the old project into the new project.
And try to avoid renaming your project from now on, because there is a bug in some versions of Xcode where it crashes and destroys the project in just the way you describe in your question.
And update to the latest version of Xcode, because it is less likely to cause this problem (though in fact I have not found it reliable for renaming projects even now).

Related

What is the simplest way to copy project folder to new Mac with updated IOS and Xcode?

I recently acquired a newer MacBook to run the most recent iOS and Xcode versions. I copied a project folder to the new Mac and opened it with Xcode 11.4 (was 10.1 on old Mac). I get 14 errors all related to "Failed to render and update auto layout status for ..VeiwController". The simulator runs fine, but the main storyboard doesn't render the button icons properly. I can add new constraints to the buttons to show them properly but the errors don't go away. I assume I have lost some info/files related to autolayout when I copied folders. I have read about similar issues. Most talk about using Github or some other 3rd party for maintaining files. Is there any other way to get this done? It seems like updates computers/software should be simpler.
Since reporting this, I have used the same process of copying folders of all other projects and have had no problems. But one project, the largest and most complex continues to have 14 rendering errors and always the displayed err message "An internal error occurred. Editing functionality may be limited." The strange thing is going in and out of viewing Main.storyboard several times gets rid of the errors eventually. Unfortunately, the errors always come back when I open the project. And sometimes they go away, then come back randomly in the same session.
So the answer to "whats the simplest way to copy a project folder to new computer is just that - Copy the project folder! But thats the wrong question for this problem.

Xcode 8.3.2 keeps on building after every keystroke

Whenever I try to change anything in my source files, the Xcode builds the entire project.
And since, I am in between writing the code, its obvious that there are errors (like "NSLog(#"ABC")") will throw an error if written halfway like this "NSL").
If I leave it idle, it fails for 5 to 10 times more and finally I see build succeeded. And again, when I try to change anything, it rebuilds on every keystroke and fails.
I have tried unchecking, "show live issues", "continue building after errors". Even a deep clean (command+shift+alt+k). After cleaning, its ok, but when I rebuild again, the same nut job building process continues.
This issue is not related to IBDesignables also. I have tried to uncheck "Automatically refresh views" in the storyboard and it did not work.
Any help?
Looks like, I can't open my storyboard as a different window, not even in a new tab. I used to have one of my windows for the source code and one for storyboard only. This made the switch between storyboard and source code much faster. But may be because of IBDesignables, its not possible anymore.
The problem is partially solved. Even if I open my storyboard now, it shows the same behavior of rebuilding again and again. But atleast, I can write my code in peace now with only source code files open in different tabs/windows.

Interface Builder cannot find .xib - Xcode 5.0.2

I recently became interested in mobile app development and want to take my coding experience from elec. engring to the iphone. Im having trouble though. I am trying to compile my first app onto my phone (got it to run perfectly on the iOS simulator last night). However, upon compiling i get the following error:"Interface Builder XIB Compiler Error: Interface Builder could not open the document "xxx.xib" because it does not exist"
I've tried going into my target and setting Main Interface to xxx.xib and I still get the same error on both iPhone and iOS simulation. I've tried setting my interface to Xcode 4.6 and messing with the builds and views, still have the same issue. I built it from scratch - same issue.
All help appreciated. I know the default is building with story board, but I am following a book I am happy with and I want to go through it with the .xib because thats what the book uses. Thanks -
Select your project (blue icon) in the project navigator then choose:
Build Phases > Copy Bundle Resources
Make sure your xib file is on the list. You can add it by clicking the plus (+) icon on the lower left.
UPDATE:
Consider opening a new project as a sanity check. Change the background color and verify that it runs in the simulator. If it does then this will point to a project settings issue rather than an installation problem.
You may also want to look at the following walkthrough by Apple. Hopefully following the steps will help illustrate anything you might be missing.
Apple also has a latest tutorial that I recommend you walkthrough. After completing please let me know if you are continuing to have this problem. The number of potential problems is greater than simply walking through the 15 min tutorial.

xcode 5 can't see NSLog(s) from old iOS project

I have an older iOS6 app that I was playing with last year; it was only for my wife, so I never released it, but I wanted to dust it off and see if it was potentially useful to others. So I load it up in XCode5 (5.0.2 running on 10.8.4; I've also tried this on my home laptop running the same XCode and Mavericks). However, though the app builds and runs fine, none of my NSLog statements show up in the console, on either computer. I've cleaned, rebuilt, run it on every simulator and iPad I have, hunted through settings, torn my hair out, etc., but I can't figure out how to get them to show up. I started a new iOS app to make sure it's not something in my setup, but NSLogs from there work just fine. Unfortunately, I'm not even sure where to start looking to fix this. Does anyone have any ideas for directions that I should be exploring here? Thanks!
Edit: I just tried copying over the files into a new project, and now the NSLogs are showing up! Still leaves me with no ideas as to why they're not showing up in the old project.
Edit2: It's not just user error; I can see the log messages from the new project with the copied files (see image). They just don't show in the old project when I run it.
Maybe you're not opened a Console in XCode 5, it seems, you're trying see a logs in member console.
Try click at here and you will see console with "All Output" option:
As noted in the comment by #combinatorial, I had a debug statement hidden (so cleverly that I fooled myself) in the pch file. Thanks so much for helping me nail that down!

.PNG not copying to device bundle

I've been stuck with a huge problem for a few days now and it is very frustrating. Everything was working perfectly until I messed around with target settings/provisioning a few days ago. Essentially no images are being copied from the project to be included in the app bundle.
I have:
Double checked their case consistency
Made sure they are all included in copy resource bundle section of
build phases
Performed multiple cleans and manual clean outs of the derived
data folder
And the images appear fine in the simulator.
I really don't know where else to turn or what else to try. Any help in solving this would be HUGELY appreciate as I am trying to release an update for an app but am unable to do so before getting this fixed.
ALso it is worth mentioning ever since this problem started occuring it happens in all of my xcode projects.
Check the build log. It's in the "Log Navigator" tab (press command-7). The build log graphically shows the results of the build steps.
Check the path of the individual "CopyPNGFile" steps. You can also open the textual log by clicking the far right button in each build step.

Resources