App crashes without any info on iOS 9.3.5

Hi,


I have the problem that my app crashes after a short time without me seeing anything in the debugger. I only get the message "Lost Connection to "iPod"..." as I had removed the cable.

Furthermore, the crash only occurs on iOS 9.3.5 devices. The error occurs in the debugger but also in the release via Testflight. Higher versions 10 to 12 do not have this problem even with prolonged use.

I use Xcode 10.1.

Can this be a problem with the memory? Can I somehow analyze this more exactly?


Kind regards,

Henning

Accepted Reply

I have now solved the problem so that I now use imageWithContentsOfFile: instead of imageNamed: and thus the images are not loaded into the cache. The result is that the storage consumption is now lower and the app doesn't crash anymore.


Thanks a lot for the support

Replies

Is the app installed to the device?


What happens if you try to run it there without being connected to Xcode?


Did you option-clean the build, then delete all versions off the device, then go again?


Are you using a paid Developer Program account or working w/Xcode's free provisioning?

Does this generate a crash report?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Do you mean the crash logs in the Xcode-Organizer from Testflight? So far nothing is displayed there. The first occurrence was two days ago.

That’s the type of crash report I’m looking for, but not the right source of those crash reports. Such reports take a while to filter through. If you’re seeing crashes on a specific device, you should be able to get the crash report off the device. There are tips for doing this in Technote 2151 Understanding and Analyzing iOS Application Crash Reports, but I usually get them from Settings > Privacy > Analytics > Analytics Data. Once you’ve found the right report you can use AirDrop to get it to your Mac.

Oh, blat, you’re on iOS 9. [Dusts off an iOS 9 test device, and I’m not talking metaphorically here (-: ] On iOS 9 the location is Settings > Privacy > Diagnostics & Usage > Diagnostics & Usage Data, and there’s no AirDrop support )-: You can, however, select the text of the crash report and share that via the selection menu. Honestly though, it’s probably easier to use the technique from TN2151.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I found the reports and logs as you described in Diagnostics & Usage Data, but the only report from my app is nearly one year old. The only logs from the last days are JetsamEvents and log-session. In this logs I can't find anything helpfull in combination with my app.

Are you sure your app wasn’t jetsammed? Old OS releases and old devices, with limited memory, are often correlated.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Yes you are right. I find a jetsam event to my app-process:


"largestProcess" : "myApp",

"timeDelta" : 37840,

"processes" : [

{

"pid" : 84,

"reason" : "vm-pageshortage",

"name" : "pfd",

"fds" : 50,

"lifetimeMax" : 261,

"rpages" : 87,

"cpuTime" : 0.038544,

"states" : [

"daemon",

"idle"

],

"purgeable" : 0,

"uuid" : "0be13fe8-87ef-3df2-aaf4-335fc2a0cd80"

},

The high memory consumption is caused by showing a number of images as an animation in an UIImageView. (see example coding)

I have some animation in the app that gradually increase memory usage.


        for (int i = 0; i < ni_animationMaxCounter; i++)
        {
            UIImage *img = [UIImage imageNamed:[NSString stringWithFormat:@"%@%d%@", ns_animationImagePrefix, i, @".png"]];
            
            [animationArray addObject:img];
        }
                      
self.imageView.image = [animationArray lastObject];
        self.imageView.animationImages=animationArray;
        self.imageView.animationDuration= 1.3;
        self.imageView.animationRepeatCount=1;
        
        [self.imageView startAnimating];


Is there another way that uses less memory?

I find a jetsam event to my app-process:

Cool. Well, uncool, but at least that explains the crash.

Is there another way that uses less memory?

I don’tt have any good suggestions, alas. I generally focus on low-level stuff (like crashes :-), so I don’t have a lot of experience with UI stuff.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I have now solved the problem so that I now use imageWithContentsOfFile: instead of imageNamed: and thus the images are not loaded into the cache. The result is that the storage consumption is now lower and the app doesn't crash anymore.


Thanks a lot for the support

For anyone else running across this, I was able to fix the crash by calling imageWithContentsOfFile: on a background thread while still being able to maintain image caching.