iPad app closes after 2 seconds, memory issue? - ios

I made a magazine iPad app so you can scroll through different slides to the left, right, down and up. It's all ready and accepted by the iTunes app store. Problem is, if someone downloads the app it closes directly after 1 seconds of loading.
Weird part is that i installed the app trough xCode and all works without any problems. My guess is that the app takes too much memory. I made a screenshot of the memory instrument:
But how can i release a Srollview if it must be loaded all the time?
Hope someone could push me in the right direction!

I have tested your app on my iPad2 with iOS 5.1.1, and it crash with the following message:
OxygenEvents[97151] <Error>: *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'
*** First throw call stack:
(0x375c388f 0x31638259 0x375c3789 0x375c37ab 0x309de54d 0x309de6bb 0x309de423 0x3096f001 0x308dd3c7 0x307bac59 0x30730c17 0x10d5d5 0x30730c8b 0x109beb 0x30730c8b 0x3072f461 0x30721e87 0x307927d5 0x10960b 0x3072fcab 0x307297dd 0x306f7ac3 0x306f7567 0x306f6f3b 0x3771322b 0x37597523 0x375974c5 0x37596313 0x375194a5 0x3751936d 0x3072886b 0x30725cd5 0x10944f 0xf0050)
It is because you use "Autolayout" in your Interface Builder files (nib / xib files), which is an iOS 6.0 only feature.
To solve this, either disable Autolayout in all your xib files like this:
or simply make your app iOS 6.0 only by setting deployment target as iOS 6.0

Related

My CN1 app crash on startup

Since today I can't run a CN1 debug the app on my iPhone 4 (iOS 9.3.5). It crashes on startup.
I've made only minor changes:
Add a button which uses execute(URL) to open a URL.
and I've got this exception:
Library not loaded
/System/Library/Frameworks/UserNorifications.framework/UserNotifications
[...]
Reason: image not found.
Can you help me, please?
That's probably a regression due to changes that went in to implement https://github.com/codenameone/CodenameOne/issues/2208
It's probably due to this commit: https://github.com/codenameone/CodenameOne/commit/a3a70fadd7dbef661351d11dc35683be3d828eda
Can you please file an issue to keep track on this?
We're looking into it.

iOS App Crashing on iPad Pro only: NSUnknownKeyException

I had a user report my app was freezing at the launch screen on his iPad Pro but working on all other devices -- an iPhone 6 plus and an iPad Mini all runnning iOS 9.2. I've had no crash reports from this release and can also see other iPad devices running the app fine, so I suspected some local file corruption issue. Just as I was writing the user about how to uninstall reinstall, I tried running the app on the iPad Pro simulator. Boom. He was right. Freezes at the Launch screen and throws an exception. (Yes, my inner Bart Simpson is writing 100x on the Blackboard: Test on all simulators before release).
Terminating app due to uncaught exception
'NSUnknownKeyException', reason: '[
setValue:forUndefinedKey:]: this class is not key value
coding-compliant for the key view.'
Elsewhere on Stackoverflow this error has been attributed to a bad outlet. As far as I can tell, no issues there:
or a Viewcontroller having a bad class. I'm eliminating that as a candidate as I don't think that would be a single-device failure, and because my app is built in Cordova it hands over to a webview.
The exception gets thrown in main.m, a cordova-generated file:
#import <UIKit/UIKit.h>
int main(int argc, char* argv[])
{
#autoreleasepool {
int retVal = UIApplicationMain(argc, argv, nil, #"AppDelegate");
return retVal;
}
}
I'd also read about issues of improperly formatted launch screens causing problems, and since the launch screen image I added for iPad Pro is a new addition to my code since last version, this was my first suspect. But I've checked pixel sizes and resolutions and all my launch screen images comply to the specs at Apple's developer site.
So. Any ideas what about the iPad Pro alone would cause a freeze immediately on launch? The app's first step is to look for a file written to local storage -- and to write one if it doesn't find it. Again, unless there's something very different about how the Pro handles local storage, I don't think that can be it as that process works across all other iOS devices. If running on actual hardware will help anyone diagnose, the app's here in the app store, and I'm happy to send a download code.
This was an embarrassingly simple issue: Don't know how, but the main interface box was scrolled to MainViewController.xib for ipad only. For a Cordova app, it should be blank, which it was in the default iPhone view for the Deployment Info page. When I clicked the iPad button the errant selection was revealed. Blanked it, recompiled, all was well.

UINib initWithNibName crash before app load

I have an iOS app that runs fine on the simulator, but crashes on all devices with this error:
<Warning>: *** Assertion failure in -[UINib initWithNibName:directory:bundle:], /SourceCache/UIKit/UIKit-3318.16.14/UINib.m:98
Apr 13 23:24:52 Feifan-Zhous-iPad splashboardd[14537]
<Error>: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: (name != nil) && ([name length] > 0)'
The app is in Swift, running on Xcode 6.1.1. The device here is an iPad Mini 4,4 running iOS 8.1 (but the crash happens on all devices including iPhones, ranging from iOS 7.0 upwards).
Notable is the crash happens before the app launches (application:didFinishLaunchingWithOptions: never gets called) and an exception breakpoint in Xcode doesn't catch anything.
The app uses a Main.storyboard file as the Main Interface file. It is not red in the Copy Bundle Resources phase. The app isn't using initWithNibName:directory:bundle anywhere.
Has anyone run into this error and found a fix? Very little to work on
I have an iOS app that runs fine on the simulator, but crashes on all devices
It looks like it must be something with capitalization of a file name. I suppose that you have installed case insensitive file system on your mac so a simulator treats name "File" as "file" (and even "FILE") while iOS devices has case sensitive file systems so file names are case sensitive.
I suppose that you've set incorrectly class name for your initial view controller and it cannot be instantiated.
You are probably initializing a nib name in initWithNibName:directory:bundle which isn't ever being called.
Move the your initialization code from initWithNibName:directory:bundle to awakeFromNib.
I had the same issue, check in the rootViewController/InitialView if you are registering a nib file with a wrong file/reference name. Had that when I registered UICollectionViewCells in viewDidLoad while making a network call, didn't show where the crash was.

Could not instantiate class named ADBannerView after Removing iAD

Weird thing that I have spent about 4 hours debugging:
Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named ADBannerView'
I used to have iAD and then removed it. Now I use Google AdMob.
I have macros set up to determine the free/paid version. On the free version that is supposed to show ads, everything is fine and it displays the AdMob ads.
In the paid version, which does not call any ads, I get this error: Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named ADBannerView'
The only thing I can think of is that I may have an old iAd Banner View somewhere, but I can't find it!
Any hints?
Also: Everything works fine on the simulator.
Have you checked to make sure that there are no ADBannerViews in Interface Builder? The sort of error you are seeing says that the app is trying to create one somewhere.
Educated guess:
are you using the UI State Preservation & Restoration API? If so return NO from application:shouldSaveApplicationState: to get rid of the current saved state.
Once that works you should implement some kind of restoration version checking to prevent crashes on your users devices.
If that doesn't work, or you are not using state restoration, try to delete the app from the device. If you deploy from Xcode files are only added, never removed. So it's possible that an old file references ADBannerView. Delete the app to get rid of such orphan files.
Edit: That link should take you to the "Encode version information along with the rest of your app’s state." section. It doesn't, but you will find a small info about version checking at the bottom of the page.

Swapped images in xcode and now app is crashing

I deleted old images in xcode project, default.png, default#2x.png, etc., replaced them all with new images with the SAME SIZE and the SAME NAME - app build succeeded but crashed when opened (didn't go beyond hang screen using testflight)
Git Hard Reset and redeployed - app worked
Changed Images again - app build succeeded but crashed when opened (didn't go beyond hang screen using testflight)
Put back old images manually without reset - app build succeeded but crashed when opened (didn't go beyond hang screen using testflight)
Clearly this is not about the new images because I put them back. No clue what is happening. Not even sure what to google here.
Edit: Sorry, I am very new to this, but I see this at the bottom:
2013-11-07 22:41:17.651 MySaleTable[1934:60b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainStoryboard_iPhone' in bundle NSBundle (loaded)'
* First throw call stack:
(0x2d52bf53 0x378556af 0x30146d41 0x2ff15b49 0x2fd07c25 0x2fca26a7 0x2fca19a9 0x2fd074fd 0x3213970d 0x321392f7 0x2d4f69e7 0x2d4f6983 0x2d4f5157 0x2d45fce7 0x2d45facb 0x2fd06799 0x2fd01a41 0x2eb45 0x37d5dab7)
libc++abi.dylib: terminating with uncaught exception of type NSException
Suggest you delete the derived data in the Xcode organizer, close and reopen Xcode. Then open the right pane file browser, and one by one seclect your storyboards and images in the left pane, and verify that it's included in the project. Select your storyboard and verify it loads in the center pane. You can also select the target and insure images and storyboards are in the Copy ToBundle phase (I forget exact name).

Resources