iPad 1 Crashing

Hi guys,
my first game ‘Backyard Bolt’ on iOS made it into the top 100 paid apps! Bad news is that I’m getting stacks of 1-stars due to a ‘crash’.
So far, we can see this only happen on iPad 1 - the default image for the app loads for about 5 seconds, then crashes back to the home screen.
On Corona Simulator, previewing as iPad1, iPad Retina, iPhone etc is all fine.
Previewing on iOS Simulator with the XCode bundle however, I get this message first:


BackyardBolt_iPhone cannot be opened because of a problem.
Check with the developer to make sure BackyardBolt_iPhone works with this version of Mac OS X. You may need to reinstall the application. Be sure to install any available updates for the application and Mac OS X.

Click ‘Send to Apple’ to submit the report to Apple. This information is collected anonymously.

Process: BackyardBolt_iPhone [3801]
Path: /Users/glaw/Desktop/projects/CartoonNetwork/TUN0001_BackyardBolt/TUN0001_Gumball_BackyardBolt/Main/src/package/xcode/BackyardBolt_iPhone.app/BackyardBolt_iPhone
Identifier: com.disney.backyardbolt
Version: ??? (???)
Code Type: X86 (Native)
Parent Process: launchd [182]

Date/Time: 2013-01-03 10:29:33.582 +1100
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6

Interval Since Last Report: 6478254 sec
Crashes Since Last Report: 21
Per-App Crashes Since Last Report: 1
Anonymous UUID: 695E9C1B-C07B-4BAA-B6DF-E19BC3C0E06C

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread: 0

Dyld Error Message:
Library not loaded: /System/Library/Frameworks/CoreMedia.framework/CoreMedia
Referenced from: /Users/glaw/Desktop/projects/CartoonNetwork/TUN0001_BackyardBolt/TUN0001_Gumball_BackyardBolt/Main/src/package/xcode/BackyardBolt_iPhone.app/BackyardBolt_iPhone
Reason: image not found

Binary Images:
0x8fe00000 - 0x8fe4163b dyld 132.1 (???) <4CDE4F04-0DD6-224E-ACE5-3C06E169A801> /usr/lib/dyld

Model: MacPro5,1, BootROM MP51.007F.B00, 4 processors, Quad-Core Intel Xeon, 2.8 GHz, 8 GB, SMC 1.39f11
Graphics: ATI Radeon HD 5770, ATI Radeon HD 5770, PCIe, 1024 MB
Memory Module: global_name
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8E), Broadcom BCM43xx 1.0 (5.10.131.42.4)
Bluetooth: Version 2.4.5f3, 2 service, 19 devices, 1 incoming serial ports
Network Service: AirPort, AirPort, en2
PCI Card: ATI Radeon HD 5770, sppci_displaycontroller, Slot-1
Serial ATA Device: HL-DT-ST DVD-RW GH41N
Serial ATA Device: WDC WD1001FALS-41Y6A0, 931.51 GB
USB Device: BRCM2046 Hub, 0x0a5c (Broadcom Corp.), 0x4500, 0x5a100000 / 2
USB Device: Bluetooth USB Host Controller, 0x05ac (Apple Inc.), 0x8215, 0x5a110000 / 5
USB Device: USB Optical Mouse, 0x0461 (Primax Electronics), 0x4d15, 0x1a200000 / 2
USB Device: Wired Keyboard 600, 0x045e (Microsoft Corporation), 0x0750, 0x1d100000 / 2
FireWire Device: built-in_hub, Up to 800 Mb/sec


The iOS Simulator still loads the game up, but it takes about a minute to get past the default image, and the game runs very slowly at around 3 frames per second.

The iPad that crashes is an iPad 1, running the latest iOS available to it: 5.1.1

Can anyone please help?

Thanks!
Garry
[import]uid: 146743 topic_id: 34500 reply_id: 334500[/import]

What all devices did you test on?

The Corona Simulator is not anywhere close to reality for the device itself. You still have all your Mac’s memory. You have all your Mac’s hard drive space. You have your Mac’s settings for MaxTexture memory and the biggy that burns almost everyone, the Mac’s OS is not case sensitive with regards to the simulator, while iOS is case sensitive with filenames.

The iPad 1 has 256M of memory and not a very fact CPU. Its like an iPhone 3Gs with a bigger screen (but worse since Apple will let a 3Gs upgrade to iOS 6, but not an iPad1).

If your app is working on other devices, then my guess is you’re running out of memory and it’s getting shut down on you. What can you tell me about your config.lua? How big are your images? How many are you loading in?
[import]uid: 199310 topic_id: 34500 reply_id: 137154[/import]

Hi Rob,
I have confirmed the following devices run without hitch:
iPhone 3G, iPhone 4 (iOS 5 and iOS6), iPad 3.

So far, it only crashes on iPad1.

config as follows:
application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,

imageSuffix =
{
["@2x"] = 2, – images with “@2x” appended will be used for iPhone, iPod touch
["@4x"] = 4, – images with “@2x” appended will be used for iPhone, iPod touch
}
}
}

the images are designed for iPhone and iPhone4 retina (which use ‘@2x’). No @4x images are used.
The overall size of the app is around 30mb [import]uid: 146743 topic_id: 34500 reply_id: 137158[/import]

I would suggest trying to find a developer who has an iPad 1 and maybe you can get them a promo code to download the app, tether it up and run it and see what the console log says.

On facebook, the Corona Indie Dev’s group (for getting reviews) has started a beta test group:

https://www.facebook.com/groups/102481146589254/

You might be able to find someone there who has an iPad and those are people who have volunteered to test thing.

[import]uid: 199310 topic_id: 34500 reply_id: 137160[/import]

Thanks Rob, what do you mean ‘tether it up’, isn’t the error on iOS Simulator (not corona simulator) a good start?
Note the iOS error only happens with the iPad, not for the iphones. [import]uid: 146743 topic_id: 34500 reply_id: 137161[/import]

I am just running a memory usage test to see if there are any leaks - it looks all stable.
collectgarbage(“count”) is sitting at around 850, and textureMem is at 120.
The iPhone version of the graphics is much smaller with 45 texture memory.

Could it be that the iPad just can’t handle the textureMemory because it uses the ‘iPhone4 retina’ images? [import]uid: 146743 topic_id: 34500 reply_id: 137163[/import]

The iPad 1 has 256M of total memory available. The OS and associate background tasks are going to take at least half that memory (or more or less, but for a starting point, lets say 1/2) which leaves you around 128M of memory, of which you’re taking 120M in texture, 1 for Lua code, some for your app’s code space so you are very likely running out of memory.

[import]uid: 199310 topic_id: 34500 reply_id: 137165[/import]

thanks Rob, do you have any suggestion how I could isolate the iPad 1 to use the normal (not @2x) images from the config.lua file?
Also, if all fails, can I build the app ‘iPhone only’ to make it unavailable for the iPad App Store, or do I need to do something else to unlist it?
Thanks again,
G [import]uid: 146743 topic_id: 34500 reply_id: 137172[/import]

You still want to use the @2x graphics so that it looks good. I think there are other areas where you can optimize things. I don’t know what audio you’re using, but there is no need for 44Khz stereo sounds when 11khz, mono tracks are much smaller both in load time and memory foot print. If you have a bunch of audio, you can gain there.

Also look for graphics that are slightly bigger than the power of 2 numbers. A 66x66 button becomes a 128x128x4 memory foot print where a 64x64 button is a 64x64x4 foot print. If you have images that are a little big larger than 16, 32, 64, 128, 256, 512 and 1024 on their long edge, resize them down to where they fit in the next smaller power of two number but still tell display.newImageRect() to use the real size you want. Example in the button case, make the image 64x64, but tell display.newImageRect(“button.png”, 66, 66). Corona will upsize that graphic a bit, should still look good, but instead of that graphic eating up 64K, it only eats up 16K. For small graphics it may not seem like much but if you have a bunch it adds up. The bigger the graphic the more important this optimization becomes.

Also if you’ve followed our recent blog posts and you’re making your background big enough to bleed on different devices to hide black bars, and your background is something like 570x360 (and it’s @2x version) then that @2x version is really 1140x720 and that becomes a 2048x2048x4 texture or 16MB of memory. It doesn’t take too many of those to blow out an iPad 1. Instead make that graphic 1024x646 but again lie when you load it and say its 570x360) and you’ve magically made that a 4MB texture instead of 16MB [import]uid: 199310 topic_id: 34500 reply_id: 137257[/import]

Hello
I had a similar problem on iPad 1
it was because i used images larger than 2048 x 2048
max texture size (set by device not IOS versions)

iPhone 2g = 1024 x 1024
iPhone 3g = 1024 x 1024

iPhone 3gs = 2048 x 2048
iPhone 4 = 2048 x 2048
iPad 1 = 2048 x 2048

iPhone 4s = 4096 x 4096
iPad 2 = 4096 x 4096
iPad 3 = 4096 x 4096

Don’t know if this helps
but worth a try
good luck!

[import]uid: 147488 topic_id: 34500 reply_id: 137263[/import]

What all devices did you test on?

The Corona Simulator is not anywhere close to reality for the device itself. You still have all your Mac’s memory. You have all your Mac’s hard drive space. You have your Mac’s settings for MaxTexture memory and the biggy that burns almost everyone, the Mac’s OS is not case sensitive with regards to the simulator, while iOS is case sensitive with filenames.

The iPad 1 has 256M of memory and not a very fact CPU. Its like an iPhone 3Gs with a bigger screen (but worse since Apple will let a 3Gs upgrade to iOS 6, but not an iPad1).

If your app is working on other devices, then my guess is you’re running out of memory and it’s getting shut down on you. What can you tell me about your config.lua? How big are your images? How many are you loading in?
[import]uid: 199310 topic_id: 34500 reply_id: 137154[/import]

Hi Rob,
I have confirmed the following devices run without hitch:
iPhone 3G, iPhone 4 (iOS 5 and iOS6), iPad 3.

So far, it only crashes on iPad1.

config as follows:
application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,

imageSuffix =
{
["@2x"] = 2, – images with “@2x” appended will be used for iPhone, iPod touch
["@4x"] = 4, – images with “@2x” appended will be used for iPhone, iPod touch
}
}
}

the images are designed for iPhone and iPhone4 retina (which use ‘@2x’). No @4x images are used.
The overall size of the app is around 30mb [import]uid: 146743 topic_id: 34500 reply_id: 137158[/import]

I would suggest trying to find a developer who has an iPad 1 and maybe you can get them a promo code to download the app, tether it up and run it and see what the console log says.

On facebook, the Corona Indie Dev’s group (for getting reviews) has started a beta test group:

https://www.facebook.com/groups/102481146589254/

You might be able to find someone there who has an iPad and those are people who have volunteered to test thing.

[import]uid: 199310 topic_id: 34500 reply_id: 137160[/import]

Thanks Rob, what do you mean ‘tether it up’, isn’t the error on iOS Simulator (not corona simulator) a good start?
Note the iOS error only happens with the iPad, not for the iphones. [import]uid: 146743 topic_id: 34500 reply_id: 137161[/import]

I am just running a memory usage test to see if there are any leaks - it looks all stable.
collectgarbage(“count”) is sitting at around 850, and textureMem is at 120.
The iPhone version of the graphics is much smaller with 45 texture memory.

Could it be that the iPad just can’t handle the textureMemory because it uses the ‘iPhone4 retina’ images? [import]uid: 146743 topic_id: 34500 reply_id: 137163[/import]

The iPad 1 has 256M of total memory available. The OS and associate background tasks are going to take at least half that memory (or more or less, but for a starting point, lets say 1/2) which leaves you around 128M of memory, of which you’re taking 120M in texture, 1 for Lua code, some for your app’s code space so you are very likely running out of memory.

[import]uid: 199310 topic_id: 34500 reply_id: 137165[/import]

thanks Rob, do you have any suggestion how I could isolate the iPad 1 to use the normal (not @2x) images from the config.lua file?
Also, if all fails, can I build the app ‘iPhone only’ to make it unavailable for the iPad App Store, or do I need to do something else to unlist it?
Thanks again,
G [import]uid: 146743 topic_id: 34500 reply_id: 137172[/import]

You still want to use the @2x graphics so that it looks good. I think there are other areas where you can optimize things. I don’t know what audio you’re using, but there is no need for 44Khz stereo sounds when 11khz, mono tracks are much smaller both in load time and memory foot print. If you have a bunch of audio, you can gain there.

Also look for graphics that are slightly bigger than the power of 2 numbers. A 66x66 button becomes a 128x128x4 memory foot print where a 64x64 button is a 64x64x4 foot print. If you have images that are a little big larger than 16, 32, 64, 128, 256, 512 and 1024 on their long edge, resize them down to where they fit in the next smaller power of two number but still tell display.newImageRect() to use the real size you want. Example in the button case, make the image 64x64, but tell display.newImageRect(“button.png”, 66, 66). Corona will upsize that graphic a bit, should still look good, but instead of that graphic eating up 64K, it only eats up 16K. For small graphics it may not seem like much but if you have a bunch it adds up. The bigger the graphic the more important this optimization becomes.

Also if you’ve followed our recent blog posts and you’re making your background big enough to bleed on different devices to hide black bars, and your background is something like 570x360 (and it’s @2x version) then that @2x version is really 1140x720 and that becomes a 2048x2048x4 texture or 16MB of memory. It doesn’t take too many of those to blow out an iPad 1. Instead make that graphic 1024x646 but again lie when you load it and say its 570x360) and you’ve magically made that a 4MB texture instead of 16MB [import]uid: 199310 topic_id: 34500 reply_id: 137257[/import]

Hello
I had a similar problem on iPad 1
it was because i used images larger than 2048 x 2048
max texture size (set by device not IOS versions)

iPhone 2g = 1024 x 1024
iPhone 3g = 1024 x 1024

iPhone 3gs = 2048 x 2048
iPhone 4 = 2048 x 2048
iPad 1 = 2048 x 2048

iPhone 4s = 4096 x 4096
iPad 2 = 4096 x 4096
iPad 3 = 4096 x 4096

Don’t know if this helps
but worth a try
good luck!

[import]uid: 147488 topic_id: 34500 reply_id: 137263[/import]