simulator vs build. Things not working on device build

I am having problems with making a build. Items that work perfectly fine when I run in the simulator do not work on the actual ipad device build.

  1. Click events do not work only in certain cases
  2. sounds that work on the simulator do not work on the actual device, only some sounds.

I have sent a copy of my code and an email to tom (i received a reply to an earlier bug I found in the build process from him so I replied and re-sent my code to that email. I also just sent to support@anscamobile.com, would appreciate if you guys could take a look sometime as it’s hindering progress and being able to make and test on the actual device. Thanks! [import]uid: 6317 topic_id: 1668 reply_id: 301668[/import]

I replied to your email but your email service rejected the response:
“Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the recipient domain.”

I’ve downloaded your code and will try and look at it tomorrow.

-Tom [import]uid: 7559 topic_id: 1668 reply_id: 4851[/import]

I replied to your email but your email service rejected the response:
“Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the recipient domain.”

I’ve downloaded your code and will try and look at it tomorrow.

-Tom [import]uid: 7559 topic_id: 1668 reply_id: 4852[/import]

oh wow thanks Tom, not sure why it did that, i’ll have to send google a message to let them know. Regarding the things loading on the simulator but not the device, I did find out that there is some issue when building with certain PNG files. not sure what it is but some of them are giving an error during the build even though they were created in photoshop like all the others and work fine in simulator. I’m still not sure what’s going on with the sound effects that are working on simulator but not device, didn’t see any errors during the build process on that .caf file. [import]uid: 6317 topic_id: 1668 reply_id: 4853[/import]

The only issue I know of PNG and sound files working on the Simulator and not on the device is when the file name requested and found are not exactly the same. For example, if the file name is Test.png but the code is loading test.png, the simulator will warn you but still load the image. The device won’t. Same goes for sound files. In another instance, I’ve seen the file extension left off (e.g. test vs. test.png) and the Simulator still loaded the file because internally it knew it was a PNG file. The device doesn’t do that.

I’ve filed an internal request to make the simulator and device operate the same in regards to how file names are treated.

As far as sound formats that play in the Simulator but don’t play on the iPhone/iPad, .MP3 is the only one that won’t play using media.playEvent.

-Tom [import]uid: 7559 topic_id: 1668 reply_id: 4855[/import]

I originally thought it was something like that, there are no warnings or errors of any kind when i run in the simulator. I have also double checked and made sure the file names and the file being called are the exact same so this is not the issue. The PNG was also the same filename, however for some reason when i tried to do the build it said that there was some error doing the PNG compression, but it was valid and recognized by simulator and photoshop [import]uid: 6317 topic_id: 1668 reply_id: 4856[/import]

The PNG file could be ill-formed and recognized by the Mac OS but not on the device. You might try reading it into Photoshop and exporting it as a PNG to see if that helps.

I’ll take a look tomorrow.

-Tom [import]uid: 7559 topic_id: 1668 reply_id: 4858[/import]

Tom there appears to be another major bug in corona that i’ve noticed before but is still happening. In all the apps I’ve created, this one included that I sent you, if you leave it running on device for long enough suddenly the app crashes and the background image seems to be super zoomed and in your face, other events stop working. It never happens in simulator, and doesn’t have to be user interactivity, just leaving it running on the device for long enough is sufficient to make it happen. I could never figure out what was causing it so I never came up with a solution for my released apps so its present in the ones i released to the store also [import]uid: 6317 topic_id: 1668 reply_id: 4889[/import]

I took a quick look at your program and ran it in the Simulator and on my iPad. The reason the back “button” doesn’t work is because of the bad PNG file you see during the build. I used Photoshop to read the photo (“4_background.png”) and then exported it as a PNG and it works fine.

I do hear sounds on the iPad but I don’t hear the page turn sound. Is this the sound you say is missing or are there others.

I haven’t seen the problem you mentioned leaving the app on. The way your app is set, the device will time-out after a few minutes. Did you disable the time-out to get it to fail? How long does it take to crash?

My first guess would be something is consuming lots of memory and causing the crash. Have you run the app using Xcode Instruments (Leak Test). It’s usually a good indicator if memory is a problem. It will also tell you if you are not freeing display objects because the memory allocation will grow and grow.

-Tom [import]uid: 7559 topic_id: 1668 reply_id: 4928[/import]

Thanks yes i did fix the PNG issue, not sure why the first time photoshop created the PNG it was “bad” but the fix is fine. The sounds do work, but the pageTurn.caf file does not work on device yet does on simulator. can’t find any reason that might not work yet. And the crash is not a device time out, simply leaving the app open is enough to cause a “crash”. it usually happens after random amounts of time, in other apps I have written it can happen while the user is still playing the game, on this app it has happened after just letting it sit there for between 8-10 minutes on page 2. I did test with xcode instruments and was unable to see the memory doing anything funky so not sure what next to try. [import]uid: 6317 topic_id: 1668 reply_id: 4929[/import]

I looked at the pageTurn.caf and it does play in the Simulator but not on the iPad. You are using playEventSound which only supports .CAF and .AIF on the device. The Simulator (through Mac OS) also supports .AAC files. Loading your file into Amadeus Pro, I found that your .CAF file was compressed as an AAC file, which explains why it played in the Simulator but not on the iPad.

I saved your file out as an uncompressed .CAF file and now it works on the iPad.

A very weird bug.

About your screen/crash problem. I did see a strange graphics issue after keeping your app running for over an hour. I was on the screen with the turtle just behind the rabbit on the trail. One of the purple bushes became very large and blocked out the road but the some objects were still in the foreground and didn’t not change in size. I have a before and after image if you’re interesting in seeing it. the app didn’t crash and when I changed pages, it fixed itself. Not sure what’s causing that.

Tom [import]uid: 7559 topic_id: 1668 reply_id: 4933[/import]

Thanks, the crash seems to have odd behaviour, sometimes it stops event listeners from occuring, other times it makes the background huge and take over the screen. In the case of the other app I wrote “astro junk” after a certain amount of time, the background image would randomly go absolutely huge (like 800% of original size) and all the transitions would stop, and no new items would be generated. Never could find a fix for that bug either [import]uid: 6317 topic_id: 1668 reply_id: 4934[/import]

If you have any small sample code that demonstrates the problem, please send it to us. I’ve never heard of anything mentioning this problem before.

I had your app on the “Lunch” page and went to dinner. What I returned the “Lunch” sign was missing but everything else was normal.

Update: I think the lunch sign rotated out the screen and stopped.

I noticed that your code uses timer.performWithDelay. There is a bug associated with this function (case #139) where the timer stops firing events after 13 minutes. You can see it with the Clock sample program. If you disable the device’s sleep mode or keep the device active, the time will stop updating around 13.5 minutes.

I didn’t look at your code to see if this would apply to what you’re doing but it may explain some of the things you’re seeing.

-Tom [import]uid: 7559 topic_id: 1668 reply_id: 4936[/import]

Doesn’t seem that’s the issue, when this happens its not always at 13 minutes, and i don’t have any timers that are longer than 13 minutes, they are all timers that are maximum length of maybe 60 seconds. It also seems from the reports I had that when this happens, everything on the screen stops working, and you wouldn’t be able to go next/previous. The particular case you mentioned is odd though as there is no code that should cause the lunch sign to rotate out of the screen and stop working. I have asked my testers to see if they can come up wtih precise steps to duplicate, but from what they’ve told me so far this behaviour is not quite the same. [import]uid: 6317 topic_id: 1668 reply_id: 4940[/import]

I was mistaken about the lunch sign stopping. I didn’t realize how slowly it was moving and I thought it was missing. I never saw the problem you mentioned on that screen. The only page with the problem was the one with the turtle and rabbit on the trail with the objects dropping down after the background was displayed. I wonder if the problem is related to the drop downs?

-Tom [import]uid: 7559 topic_id: 1668 reply_id: 4971[/import]

what was the problem you saw on that page? the app stopping after a period of time? The dropdown piece is a simple transition from a Y coordinate above the screen to some y position on screen [import]uid: 6317 topic_id: 1668 reply_id: 4972[/import]

That was the page I mentioned. After an hour part of the purple bush in the background became very large. Most of the graphics in front of the bush were still there and the correct size. I have a screen shot if you’re interested in seeing it.

-Tom [import]uid: 7559 topic_id: 1668 reply_id: 4975[/import]

Thanks Tom, I just emailed you an attachment of the bug that was reproduced this morning. It’s really strange and i cannot find anything in the code that could possibly cause it. [import]uid: 6317 topic_id: 1668 reply_id: 4976[/import]