0

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!

Jordan Smith
  • 10,310
  • 7
  • 68
  • 114
  • you can delete your app from the simulator also. – Robin Apr 05 '12 at 10:35
  • @Robin thanks, should have said that I've tried this too. – Jordan Smith Apr 05 '12 at 10:36
  • @Jordan Have you tried by deleting your app from the DerivedData folder? – Mat Apr 05 '12 at 10:38
  • @Mat whereabouts is the folder located? Spotlight can't seem to find the folder. – Jordan Smith Apr 05 '12 at 10:40
  • @Jordan see [this](http://stackoverflow.com/a/4282467/251513) – Mat Apr 05 '12 at 10:42
  • by default my location is /Users/mat/Library/Developer/Xcode – Mat Apr 05 '12 at 10:43
  • @Mat thanks! Deleting it just gives the same result though. Looks like this is where it's building to though, and the .app file is very small - it doesn't contain any of the resources that should be included. hmm – Jordan Smith Apr 05 '12 at 10:47
  • Consider that there **is** an arithmetic error on the line and that something else changed such that there is not an arithmetic error. Just because a line of code works for a while does not mean it is error-free, just that it is working by coincidence. Show the line of code and the error message (copy and [past into your question). – zaph Apr 05 '12 at 10:53

2 Answers2

0

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.

Dion
  • 3,145
  • 20
  • 37
0

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...

Jordan Smith
  • 10,310
  • 7
  • 68
  • 114
  • Without any code or the whole error message it is impossible to explain. – zaph Apr 05 '12 at 10:56
  • If weird things happen again: Close Xcode, locate your "derivedData" directory, delete all content of that directory (will be recreated), restart Xcode and see it indexing all files again. – Dunkelstern Apr 05 '12 at 13:22