I am confused, whenever I have an error in my Swift code, the building of the app in the simulator fails.
Today, even though I am pretty sure the code is correct (and it works), I see a few errors in my code, and even so, the app-building is successful in the simulator.
Anyone has run into this before? How can I fix it?
Thanks
screenshot
This isn't a solution, but have you tried restarting Xcode?
Related
Yesterday i was testing my app in the iOS simulator and everything was working fine. I then decided to run the app on my iPhone and i got the error unable to install application, Unknown error occurred this has happened before so I cleaned my build folder (as this has fixed this issue before) however, the same error occurred. I then ran the app in the iOS simulator again and now i get the error Unable to run app in Simulator, An error was encountered while running (Domain = LaunchServicesError, Code = 0). I find this very weird as i didn't change anything besides trying to run the app on my iPhone. I have tried every solution given on this post and still no luck.
I'm sorry if my question doesn't contain much detail but as I said I didn't change anything and it was building and running fine a minute before plugging in my iPhone and trying to run it on there.
Any help would be much appreciated.
edit
I tried running other projects (with and without extensions) and they are working on both simulator and iPhone, therefore the problem must be within my project. (my project does have a today extension)
In that kind of cases I usually :
Product > Clean
Close xCode
Delete the Derived Data (in ~/Library/Developer/Xcode/DerivedData subfolders)
Delete the app on the iPhone
Reboot the iPhone
Restart and rebuild
I had this problem. In my case, it was caused by the Build value being blank. After putting a value there, and resetting the simulator once more, the issue went away.
I had the same problem and checking the system log carefully helped me to identify a coliding library that was causing this error. You can also check this answer if you are using extensions.
Generally it means there is a problem with the build, it may be due to old cache (solved by a clean build) or a project definition error (missing library, bad definition in info.plist, etc).
In my case it happened only on iOS 8, turns out that my widget had the wrong bundle ID.
What do I do about this?
Xcode launches the app on the device and it starts up, but when it has started the image below pops up and when I click "OK" it crashes the app.
The simulator has no issues, but I cannot read the console in regards to debugging because of this. There really is not a reason why this should be happening.
Also I have no idea what code could cause this. I have no errors or warnings and everything has been fine right up until yesterday.
If there is any code or more info you need to help me with this, please ask:-)
I have removed the app, restarted the devices and my mac.
Ok I found the answer here:
Same issue here
Basically you can't do debugging on a Ad-Hoc profile:-)
I was propted by apple to upgrade my debugger settings yesterday, In doing so I have some how broken xcode.
When ever I now try to load an application (dosn't matter what version of the simulator I am using) Xcode and my simulator both freeze up. then the rainbow loader just sits their constantly turning over.
Is there any way to fix this? I'm really stuck and don't know what to do as it dose not seem like a very common problem from all the research I have done to fix this.
I am running the latest version of xcode 4.3.2 (4E2002) and using 5.1 simulator.. and have tried 4.2 simulator to the same effect.
any help in getting my xcode back up and running would be massively appreciated.
Okay so I figured out what the problem is but not a real solution...
Basically the error started happening when I was prompted by xcode to update my debugger to the LLDB version. this is what cause my simulator to keep crashing xcode.. or vice versa honastly I still dont know why this is happening but yea...
so.. what I did to get this simulator working again was go to Product>edit scheme> debugger then changed from LLDB back to GDB.. this solved my issue for now... however I need to figure out why LLDB is not working and what I should do leading into the future. hope this helps someone else.
I have facing this problem too but I got a solution either you said its temporary ... some time ios 5.1 simulator hangs when I shifted to the ios 4.1 sdk its a common practice for the developer to check it I have simply first close the simulator and again start it and then reset all the content in the preference area that its resolved my issue .. check it might be you also got resolve for apply this trick or technique.
Thanks
In my case, was too many old breakpoints tracks (788), even to deleted files, I just clean it and now it runs perfect, I hope it helps.
A picture to illustrate:
The Problem:
Until recently, I could build and test my app like normal. Now, Xcode is driving me crazy, I can't even run my app.
-
What Happens:
Building my app seems to launch it in the simulator, but it does not run and an EXC_ARITHMETIC error occurs (it stops at a line of code that was working fine before, no code changes since).
Looking at the 'products' folder, I can see that "appName.app" is red - i.e. the app file is never generated. A spotlight search and checking in the build folder confirms this.
Cleaning, restarting, etc does nothing to help. Other projects still build fine.
-
When it happened:
One of the graphic files I altered wouldn't update itself in the app, even after a 'clean'. So I deleted the build folder, as I've done many times before. Now I get the result explained above.
-
Any ideas or solutions are much appreciated!!! I can't develop as is... and have already wasted a lot of time as is. I'm more than happy to give a bounty if someone finds a good way to fix this, it's driving me crazy!
I had a similar problem too when my app always crashed at launching, sometimes it helps to delete the App from the Simulator. Simply hold the mouse on the app for some seconds, click on the X, close the simulator, rebuild and run.
Solution was to comment out the block of code that the error occurs in. Build, and then it runs fine.
Then, uncomment the same block. Build, and works fine.
Weird... compiler or maybe Xcode bug?? Feel free to try explain...
My IPhone app is suddenly giving a SIGABRT error message when I attempt to run it on my iPhone, before even the first line of the application delegate is reached. It runs fine in the simulator, and even restoring previously working snapshots give the same error when I attempt to load the application on the device.
I fiddled with the Product Name build setting and the data model prior to the problem occurring, but as mentioned, old snapshots that ran fine now won't load, suggesting that the problem isn't in the code.
I have tried restarting xCode, the computer, the iPhone and deleting the app but the problem is still occurring.
I am sure that the problem lies with the device
Any ideas what the problem might be or how I can fix it?
Taking on Till's suggestions I reinstalled iOS (well, actually I updated it to 5.1) and everything is working again. Thanks for the advice. I've no idea what went wrong, but at least its working again now!