iOS app crashing immediately - ios

My iOS app is crashing immediately without any debug info. I have a break point all objective-c exceptions.
Crashing on this line
return UIApplicationMain(argc, argv, nil, NSStringFromClass([STAppDelegate class]));
App was running fine for the past month and nothing was changed.
I cleaned are re-ran.
What is weird is it is crashing every other time I run so run once its good stop it and run again crashed .... repeat rinse same result... every other time.

I am getting closer after installing 4.6.2. Now it crashes everytime and I get this error."erminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named UIStoryboardUnwindSegueTemplate'"
This is an altogether different story, it looks like a problem similar to use autolayout on iOS version lower than 6.x...
You cannot use storyboard with iOS 5.x as deployment target.
Getting back to your original problem, Xcode 4.6.2 app crashes on every second run, it gets solved either updating to the latest XCode 4.6.3 or using GDB instead of LLDB. I suggest, however, to update to the latest version and hence use LLDB - by the way, it looks like the next XCode 5 will support exclusively LLDB.

Related

Xcode 8.2.1 & Swift 3.0.2 + Realm 2.4.x = Fatal Exception Crash

So my Swift-based iOS app with no other non-native dependencies besides Realm is crashing fatally since Realm 2.4.
I first installed Realm 2.4.1 yesterday, saw the crash, and rolled back to 2.3 thinking it was a bug, so this is definitely occurring only with Realm 2.4 and onward.
But I just installed Realm 2.4.2 today, and I'm getting the same crash, which I can't figure out the cause of due to lack of information provided after the crash (empty debug console, nothing odd I can identify in threads).
When I remove the app from the simulator and then build from scratch, the crash occurs on the last line of my Realm setup code with an EXC_BAD_ACCESS (code=1, address=0x0) error:
currentReminders = currentTab.reminders.sorted(byKeyPath: "reminderPosition", ascending: true)
On subsequent builds/launches without removing the app from the simulator, the crash and error message are the same, but it happens in a different place, though even then, it's on a line that attempts to get reminders from the reminders property in my currentTab object, which is a list of reminder objects.
Has anyone else encountered this or similar crashes since upgrading to Realm 2.4?
Please try performing a clean build. We've seen reports of Xcode failing to rebuild enough of the app when updating Realm versions, resulting in mysterious crashes. A clean build addresses those problems.

App began to crash on iOS 9.1 Beta 2

The application began to crash when installing on iOS 9.1 Beta 2. Exactly same binary (downloaded from hudson link) behaves so:
It did not crash on iOS 9.0 and iOS 9.0.1
It did not crash on either iOS 8
I have extracted the crash log, crash happens inside the call to [[NSBundle mainBundle] loadNibNamed:#"NameOfView" owner:self options:nil];. The crash itself is NSUnknownKeyException:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[< NameOfView: 0x1446a6ea0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key .'
So far i see weird key '.' which nib loading mechanism tries to set on my class, and obviously, such is not present in nib. And this looks extraweird even more, due to iOS 9.1 beta 2 is the only version with this behaviour. Moreover, building app with XCode 7 from on same git revision gives no success crashing app - it works as expected. Has anybody experienced such behaviour after trying your release versions on iOS 9.0.1 beta 2? Want to have some feedbacks of SO community before file a bug to radar. Appreciate your help, guys.
P.S. I'd like to emphasize that the issue reproduces only on that particular binary. Building it again from the same sources in XCode 7 doesn't produce a crash. So please, don't suggest how to debug such kind of problem, how to set exception breakpoint etc.
EDIT
Since 9.1 release, it's no more reproducible.
As stated in comment to original question, there's no solution and no response on bug yet.
The openradar link: http://openradar.appspot.com/radar?id=6294934587965440
I'll be posting an updates here after the 9.1 release.
There are some empiric ways to come up with solution:
Override KVC setter setValue:forKey: and forbid empty string
key.
Use always the latest stable SDK to build.
But again, no actual response from Apple neither.
EDIT Since 9.1 release, it's no more reproducible.

EXC_BAD_ACCESS(Code=EXC_ARM_DA_ALIGN) Only when running app on device from Xcode

I'm getting a really weird EXC_BAD_ACCESS(Code=EXC_ARM_DA_ALIGN) crash on my app which is written in swift but only when i run it on a 32 bit device and only if its running from Xcode (the device is still hooked to Xcode), If i start the app without Xcode it runs fine. I can't give any code since no matter what i do i get no stack trace or anything like that .Only the mention error on the AppDelegate, even though the crash is in different screens further in the app (crashes on second screen).
Any idea as to why the crash would happen only when Xcode is running the app
You are using some variable or object which is yet to be initialised. Please review your code and you will get the error. You can add exceptional break point to get the actual position of the error.
It's a memory alignment issue. Search on EXC_ARM_DA_ALIGN.
https://brewx.qualcomm.com/bws/content/gi/common/appseng/en/knowledgebase/docs/kb95.html
use memcpy
char*Code; int pc;
double f;
memcpy(Code+pc, &f, sizeof(f)); // instead of *(double*)(Code+pc)=f; that generates EXC_ARM_DA_ALIGN

iOS simulator crashes when using Google Maps SDK for iOS

This is driving me crazy...
I have been using Google Maps SDK for iOS for a while (even in an App Store product).
Now, I cannot make it run in the iOS simulator any longer! It doesn't matter which project I try to run (even the sample code from the SDK), it will always crash the first time a map is added, e.g.:
self.view = [GMSMapView mapWithFrame: frame camera: camera];
This is the log messages I get:
2013-05-16 10:59:01.047 SDKDemos[939:1303] ADDRESPONSE - ADDING TO MEMORY ONLY: http://dl.google.com/geosdk/latest
2013-05-16 10:59:01.050 SDKDemos[939:1b03] Google Maps SDK for iOS version: 1.2.2.3031
2013-05-16 10:59:01.050 SDKDemos[939:1b03] New version of Google Maps SDK for iOS available: 1.3.0.3430
2013-05-16 10:59:01.111 SDKDemos[939:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
I have lately tried an antivirus SW on this mac, so one theory is that it may have blocked some vital Google Maps data from downloading. Now, I have uninstalled this anti-virus SW, removed Xcode's DerivedData and reset the iOS Simulator, but with the same disappointing result.
All projects I have tried are working perfectly fine when I run them on my iPhone. I have also another mac where everything works fine on the simulator. So clearly something must have happened with this particular machine.
Any advice?
Update
Initially, I focused entirely on the first warning message (ADDRESPONSE - ADDING TO MEMORY ONLY: http://dl.google.com/geosdk/latest), but I have now realised that the only purpose of the URL mentioned there is to download a string with the latest SDK version number (currently "1.3.0.3430"). Since the SDK then correctly prints that string two lines further down, I find it very unlikely that this line is related to the real cause of the crash. (I have changed the title of this question accordingly.)
Hard to say if this really qualifies as an answer...
In any case, I'd like to document the outcome of this, in case someone else stumbles upon the same problem in the future:
After having been away a couple of days, I returned today, turned on my iMac, made a new test run, and...
The problem was gone!
Everything just worked as expected!
I have not changed a single line of code or anything at all in the Xcode configuration.
The only thing I did was to once again delete Xcode's DerivedData and reset the simulator (which I did numerous times last week, but without success at that time).
I guess that my assumption must have been right, that there must have been a cache somewhere in my machine, but outside Xcode´s DerivedData, that caused this problem. Then I was away a couple of days, and this cache simply timed out!
Even if this may sound a bit far-fetched, I cannot think of another reason for this weird behaviour.
It would have been really useful to know where this cache is located, so that one could clean it up without needing to shut down the mac for some days!

App crashes without reason with xCode 4

Something weird is going on here.
My app crashes on this line of code:
int end = NSMaxRange(endRange);
but I don't get any error message, and everything is fine: endRange. The app just freezes in the iPhone and that's it.
1.
The weird thing is that the same code was working before, and I've reversed from repository to see what's wrong but it still doesn't work.
2.
Also xCode removes the breakpoint every time the app crashes. I add it again, I run the app, I step over, the app crashes and Xcode removes the breakpoint.
3.
I've cleaned the build, restarted xCode, restarted the iPhone, removed the app from the iPhone. Same issues.
4.
If I don't use breakpoints, the app doesn't crash, but the code right after that line is "skipped", but it was working before. At least the app doesn't freeze without breakpoint.
What the hell ?
I've had similar problems with the debugger in the past too. Try switching from LLDB back to GDB (From the Product / Edit Scheme menu). I've found LLDB to do exactly what you are describing with breakpoints.

Resources