app crash in ios 6 - iphone

My app is working fine for iOS 5.1 simulator and less but its getting crashed for ios 6 simulator. No changes done in code for both versions. At debugging this error appears:
[unknown]Not safe to look up objc runtime data.
After googling i found this link.
Not safe to lookup objc runtime data
but nothing helped right for me.
Any help would be greatly appreciated

Related

iOS App crashing on production but not on debugging

I have been working on an iOS app. It was working fine until a couple of days ago, it started behaving strangely. The app crashes on production but it creates no crash logs. However, when same scenario is tested out in QA, it works fine. Now I have been trying to find out the reason but without any crash logs or crash in debugging mode, it has become very difficult for me.
Any suggestion, how to tackle it?
Thanks!
P.S. I am using XCode 4.6.1 and app is for iOS 6.0.
Answering my own question, I have found out after detailed research on the internet that some crashes kill the application before logging the Crash Log. My error was that of a delegate property for my services. After long hard tries, I got to the root cause of the problem, since I had converted the code to ARC so the delegate property was unsafe_unreatained, which released the delegate while it was still in use by the service, so I just had to convert it into strong and set it to nil in dealloc. Further description can be seen here: https://stackoverflow.com/a/9065105/1351911.
I had the same problem, building ipa's in Xcode 4.6.1 with sdk version 6.0 or above crashes the app like anything. Try archiving it in Xcode 4.4 or 4.3 may be a lower version and try.

Do I need to keep "recompiling" my iPhone app code everytime apple releases a new iOS version?

New here guys but have got a genuine problem. I have an iPhone app that was developed using SDK4. With apple introducing the new iOS version 6, does my code need to be recompiled on the new SDK to make it compatible with version 6?
Right now it crashes on iOS6. Also, do I need to do that everytime apple brings out a new version? I wonder every other app on earth already does that ?!
The problem with major iOS upgrades is method deprecation. It may happen that some parts of your code relies on methods that are not supported in iOS6. When this happens you should first check for API changes then recompile it with the latest API. If your code base works fine with iOS6 than there is no need for recompiling it, but unfortunately that doesn't seems to be your case.
Sometimes you don't need too. Most of the time, Apple publishes updates for libraries, so sometimes the old code is not compatible anymore. You have to recompile it, or you'll find issues.
For example I had a working app on iOS 5. With the iOS 6 update, I had to refer some code new because the app crashed with SIGABRT. Before iOS 6 it was working fine. Through Xcode's Debugger, most of the time finding issues is not hard work.
I've found that most of the time a crash will be caused by an existing bug in my application that I wasn't aware of. Subtle changes revealed it. It is rarely just a question of recompiling, but of fixing that bug.
Just recompiling can be dangerous. Apple can (and does) detect what version of the development tools your app was compiled with, maintains some behaviour that will keep your app running. Update, and you'll get the new behaviour instead.
I didn't have to recompile mine just for the sake of IOS6. They worked fine. But I had to adjust for 4" iphone 5 screen.

Xmppframework for iphone works fine on simulator but not on device?

I am trying to see how the xmppframework for iphone works. Everything working perfectly on the simulator but not on device. I get a EXC_BAD_ACCESS after it receives the users thats are online.
Any ideas or help?
I have an iPhone 3G ios 4.2.1.
Got the same today with the iPhoneXMPP sample in the iOS simulator.
In XMPPStream.m line 1181, adding the following check seems to fix it for me :
if (myPresence!=presence)
{
[myPresence release];
myPresence = [presence retain];
}
From Apple documentation.
This kind of problem is usually the
result of over-releasing an object. It
can be very confusing, since the
failure tends to occur well after the
mistake is made. The crash can also
occur while the program is deep in
framework code, often with none of
your own code visible in the stack.
More
Check the below SO post
EXC_BAD_ACCESS signal received
How do i resolve EXC_BAD_ACCESS errors encountered in iphone development
how to debug EXC_BAD_ACCESS on iPhone

Xcode - No provisioned iOS device is connected

I was using Xcode this afternoon and debugging an app on my device just fine. When I got home from the office and plugged in my phone to keep working, XCode would no longer let me debug on my device. The error I received was:
Error Starting Executable. No provisioned iOS device is connected.
So I hopped over to the Organizer, and here is what I saw:
So what gives? Anyone seen this before?
Thanks!
Well I don't know why this helped, but if anyone else sees this thread the thing that "fixed" the problem was to remove the SDK from my machine, restart XCode, then plug in the device. XCode then popped up an alert view asking to collect the debugging symbols from the device, which I allowed it to do. From then on it worked like a charm.
You may be testing your application on simulator and accidentally, device is selected instead of simulator. It help me to sort out this problem.
Make sure you have upgraded to the latest Xcode 3.2.5 with iOSK 4.2.1 SDK.
I had another way of fixing this problem.
I tried upgrading my device to iOS5 Beta 7 ...to test my app in iOS5
Once i finished testing it, wanted to get back to iOS4.3.5 on my device...
it took a little pain but managed to restore it back to the original
but then the debugging didn't work and got the same error as mentioned here.
So i wanted to see what i see in that snapshot that you have : and there it was...
A button called "enable for debugging" if i'm not mistaken.
Worked like a charm.... :)

IPhone OS4 feature link error while run on OS3.x

I've compiled an app with IPhone base SDK 4.0, deployment target on iPhone OS 3.0. This app contains OS 4.0 new feature: local notification.
It works well on iPod 2G with OS 4.0; however it crashes every time the app start up on iPhone 1G with OS 3.0. It appears to be runtime reference error:
"dyld: Symbol not found: _OBJC_CLASS_$_UILocalNotification
Referenced from: /var/mobile/Applications/73A3FAB1-63AE-4A71-8C6B-932142A728FE/Tapatalk X.app/Tapatalk X
Expected in: /System/Library/Frameworks/UIKit.framework/UIKit"
If the UIKit framework is different between SDK3.0 & SDK4.0, why it doesn't report while compiling? How can I apply local notification feature on this app, while the app can still running on devices with OS3.0? Thanks.
This answer solved the problem for me:
That error is being triggered because
you didn't weak-link the UIKit
framework. The UIKit framework in
iPhone OS 3.2 added the
UISplitViewController, and if you link
it in as normal your application will
assume those symbols exist on 3.0,
where they don't.
To weak-link a framework, find your
application target in Xcode, inspect
it, and go to the General tab. At the
bottom of that tab should be a list of
frameworks, with a column for Type.
Change the Type for UIKit from
Required to Weak and rebuild your
application. That should take care of
the runtime errors.
This seems safe to me, given that UIKit is always going to be on the devices we're targetting.
If you use a 4.0 SDK feature and you want to support 3.0 devices, you need to check that the functionality exists before you use it.
If you're using a new class (as you are) something like the following should work:
Class localNotificationC = NSClassFromString(#"UILocalNotification");
if (localNotificationC) {
UILocalNotification* localNotification = [[localNotificationC alloc] init];
// do stuff
[localNotification release];
}
else {
// what to do with the 3.0 SDK
}
As for why the compiler doesn't tell you, well, you told the compiler that you were using the 4.0 SDK and those classes/methods work on 4.0.
I found this information really useful. However my question is how to test if the application crashes or not after this change.
The background is I had the same issue with my iPad application. I have my BaseSDK set as 4.3 and Deployment target is 3.2. I never got this crash while doing ad-hoc provisioning and running the app on 3.2 iPad and it got approved by Apple too. But users reported that when they started the application after download on iPad 3.2 it crashes before showing the main screen even.
I was using [UILocalNotifition alloc] in my code which I think could be the result of below crash:
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x00000001, 0xe7ffdefe
I seem to have fixed this by converting the above statement as per Stephen's suggestion.
However I really don't know how to test it. I am not getting any crash earlier too while testing the application before submission on 3.2 and currently also I am not getting any crash on start up.
I really need to validate this fix before I push the update to app store. Could someone please shed more light on how to test this? It would be really helpful if I can reproduce this crash with the previous version of my application and the same is not the case with current version after this fix.