Application crashing in Distribution mode not in debug mode - iphone

I am facing an issue for which I am giving a try a to explain here. (I don't know I will be able to explain).
I made an iPhone application having the base sdk version current and target OS devices as 3.0 the application was running well until I tried to build for iPhone 5.0.
Now when I am making the build for iPhone 5.0 the build is running fine in debug mode but its crashing in Distribution mode. I am consuming some webservice in the application using SOAP. The first step of authentication using the webservices is working fine in both mode but I am not able to move further in distribution mode. Moreover I feel very helpless as I am not able to find the right place from where the issue is being generated.
I know that's a weird thing to ask but still I am hopeful that somebody would have faced a similar challenge and would have overcome it. So the knowledge-full would enlighten me too.

What is "Distribution mode"? Do you mean "Release" configuration? Which one you have? llvm 3.0? Is your project ARC-enabled?...
(Anyhow, first thing I would do is replacing -Os Fastest, Smallest optimization with no optimization. Try to run.)

Try these
iPhone Codesign object file format invalid or unsuitable
http://www.iphonedevsdk.com/forum/iphone-sdk-development/5429-codesign-verification-nightmare.html

Related

App download with webclient not working on device but work on emulator, monotouch iphone

I'm downloading json data in my monotouch iphone application by webclient. and using json.NET 4.0 R3 for MonoTouch for parsing json data.
Every thing is right on emulator but on when I create a ad-hoc api file and install it on the iphone it does not work.
I have not device on my hand to debug it and find the errors. can any body help me from what may be the diffrent on emulator and device?
I have no idea if this is your issue without further information, but I know I ran into an issue with my app where it worked fine in the simulator but failed on the device. My issue was because of trampolines. I had to increase mine when running on a device. Here is an example of this problem: MonoTouch SIGABRT "Ran out of trampolines of type 2" error
EDIT
I had that issue (where the app wouldn't download) also with my in-house deployment. Are you using the correct certificate to sign the app for distribution? You need to make sure that you are using a Distribution certificate. You need to make sure you have a certificate here: https://developer.apple.com/account/ios/certificate/certificateList.action?type=distribution and a provisioning profile here: https://developer.apple.com/account/ios/profile/profileList.action?type=production.
Have you connected a physical device (provisioned for development) for debugging and made sure that it correctly works on the device? This needs to be your first step. If this works, then the issue is likely a certificate/provisioning profile problem and has nothing to do with MonoTouch.
It is not from webclient. Please consider on your codes for parsing json by json.NET 4.0 R3 for MonoTouch. It is better that use JSON.Net componnet that xamrin himself published.

iOS App with Static Lib crashes ONLY on launch of Archive Build loaded Ad Hoc. Can't reproduce in Debugger

I realize this is a stretch and I can't give much info to help but I am reaching for anything. My App has been under continuous development for 3 years and never seen anything like this. I recently submitted a small point release to Apple for Release, and twice now it has been rejected for Crashing on Launch on ALL their devices?
The Crash reports point to some code in static library but the key lines are not getting symbolicated. Tried Atos no luck.
The key point is that I have 7 devices I have tested the app on in every mode I can think of, in particular no connection to anything: Wifi-OFF, AirplaneMode-ON, Location services-OFF. I can NEVER simulate what they claim to be seeing, which is App crashes on launch every time?!
I found one report in the AAPL Dev Forums that sounded similar, but he never got any explanation as to what was up. After he submitted an app with loads of logging in it out of desperation and asked them to send the logs. They got that version and... approved it in hours.
Anyone have ANY ideas. I NEED to get this release out.
NOTE: Resolved
This turned out to NOT be a weak link issue. We only saw the crash when running the App using Ad Hoc distribution of the Archive version as Brad suggested... so that was helpful.
However the resolution turned out to be some compiler flags which I listed here:
https://stackoverflow.com/a/10302012/754494
I'll repost and expand upon my comment from above so that this question can have an accepted answer.
I recently came across a case similar to this when building my GPUImage framework. It appears that the build process is slightly different when archiving than when building and directly installing an application on the device via Xcode.
This can be exposed by building and archiving the application, then choosing to distribute it for ad hoc or enterprise distribution. Take the .ipa and place it in iTunes and manually load it on one of your test devices that way. The behavior of an application prepared in this manner may differ from one built and installed through Xcode, and should be closer to how a build submitted for review will act.
In my case, the problem was due to a lack of proper weak linking. On SDKs newer than iOS 4.3, you should no longer need to weak link whole frameworks if you wish to conditionally use classes and functions that are present in newer SDKs but missing in older ones. If you target 4.0 and higher, the linker should now perform class- and function-level weak linking.
However, this was failing for people using my static library, which does runtime checks for the presence of the new texture cache functions in iOS 5.0, but it only failed in these archived builds. I never saw it in all my testing against 4.x devices, because that was done by installing via Xcode. In the end, I needed to have users explicitly weak link the entire Core Video framework in order to get applications using this framework to run properly when archived and installed via iTunes.
Note that this wasn't due to the Release vs. Debug build configurations, because I tried switching between these in my build schemes when deploying to the device through Xcode and it made no difference there. Something else is different in the way that archived applications are built and linked.

Newbie: Errors in an iPhone app

I'm really newbie in iOS and I have to handle a complicated situation. I was given an iPhone app developed by someone and I have to make it work. The guy who developed it has told me that it worked, but sometimes crashed in an iPhone. I've never developed using iOS and I don't really know how this app works.
Well, when I open the app with Xcode, the first problem that I detect is some errors with the references. The app uses the project CorePlot-CocoaTouch.xcodeproj. I've added again this project and solved the references (I've followed some other posts like this one: http://www.jaysonjc.com/programming/pie-chart-drawing-in-iphone-using-core-plot-library.html).
I want to test it with the simulator (I don't have an iPhone yet). I have a doubt here...should I use iOS Device, or iOS Simulator as Base SDK? Firstly I chose iOS Simulator, but it appeared a problem with Cocoa.framework (it turned into red).
Anyway, using iOS Device as Base SDK, I build the project and it says "Build failed (59 errors, 3 warnings)". I check out the errors, and most of them are "Expected specifier-qualifier-list before ..."
Can anyone help me? This is more or less the situation, but I can provide more specific details if they're needed.
I'm sorry if I'm talking about something really basic, but I've been trying to solve it for 2 weeks and I give up. I've tried to talk to the guy, but he's not really helpful..
Thanks for the replies!
By the way, I didn't say it and I don't know if it's relevant or what it means. The guy has a directory called "Libraries" where it's stored the CorePlot. The files there are the same than if you download the CorePlot project from other source. The only exception is a folder called "SDKBuild", which contains files like "build.sh", "iphoneos-SDKSettings.plist" or "iphonesimulator-SDKSettings.plist". I'm really newbie, so it's probably obvious, but I have no idea...
just try to add CocoaTouch framework to your project.
and for base SDK use "latest iOS".
Right click on the project name in 'group & files' set on the left of xcode. Choose add -> Existing Frameworks.
Find Cocoa.framwork and click add. Do this to all red colored framework.
Choose IOS Simulator as base SDK.
Try run it..
If you want to run the app on simulator, you have to build with iOS simulator. The base SDK basically sets the OS version (this will be the same regardless of whether you are running the app on simulator or device). You should be chaining the build settings to device only if the device is connected and if you have installed the appropriate provisioning profiles.

Debug and Release Build works fine but the Distribution/AdHoc Crashes

HI there,
Some users of my application have reported me that my application is no longer working. It closes just after launching it.
I have been trying to identify the crash for days with no luck using builds debug and release and testing it in several devices. This morning I was surprised when I was able to reproduce the problem by generating a AdHoc version and installing it on my iPhone.
I have already tried to remove all the custom configurations and recreate them using a copy of the release version but it did not work.
I got this error below when I was running in the simulator and the crash reports also points to the same place...
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:fwrite$UNIX2003 called from function -[My7zipExtract extract7zFile:]
So, my question is: What is the difference between build Debug/Release and Distribution (App Store/Ad Hoc). I have double checked everything and the only difference are the certificates.
Any help is appreciated.
Many thanks
I'm having precisely the same problem right now. I copied my Debug Xcode configuration to create the AdHoc one, adding entitlements and changing the certificate.
Doing good old printf-debugging ;) i found that the c++ constructors seem to be called differently / not called at all on the iPhone when using the AdHoc build.

Will old source code run with SDK 4.2?

I've been working on creating my own iPhone app with source code my company gave me. This code was created with iPhone SDK 3.0. I've worked on it for over a year (I'm a designer so my coding is mostly copy and paste) and to test the app on my iPhone it says I must update my SDK to 4.2. I'm wondering will this break my app? I probably don't have the skills in xcode to upgrade my code if I am required to rewrite parts.
Thanks,
Chris
If none of the code has been deprecated, changed or even removed, chances are good it still runs fine. Most projects run, and if you have used external code (and hopefully noted where you got it from) there might be an update available for that piece of code.
Just set the deployment target to iOS 3.0 in your project settings
here some little explanation: link