Corona Simulator not Matching Real App

The simulator is showing everything the way i want it.

But when I build the app and put on to my phone, it crashes in certain areas.

2 months ago i didnt have a problem.

1 month ago i installed JDK7, java, for school. does this have something to do with it?

I also installed android ADT pack/bundle.

Also, i tried deregistering , deleting, reinstalling, and re registering again with corona but it does the same thing.

I also notice that when I used to make builds from corona, since i have the trial version, it would startup with an alert saying that this is the trial version of corona. Now when i build an app and open it, it doesn’y give me that alert.

Please help this is ridiculous! Like 2 examples: the entire app works until i get to one scene where when a button is tapped, it should go to the next scene but SOMETIMES crashes.

Also, if that next scene does load, the background image does not match the jpg in the code! Yet the simulator does it fine. The image is a black and white gradient, but when the app is ran on my phone, it shows as all white.

Just really weird…please help!!

Hi Isiah.  We need a bit more information to help you.  

What version of Corona SDK are you using?

Can you look at your device’s console log and see what error messages you are getting?  You might want to read this blog post:

http://www.coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

We need to know if anything is going on under the hood.  Besides helping you get that information, it’s has helpful other information that you can use to help determine the problems.  Also, make sure you’ve running the latest version and keep in mind if you had an older version (which the comments about the “Trial version” makes me think you have updated to a newer version) and have moved to a newer version, our API calls change over time and if you’ve not kept things up, it can lead to similar problems. 

But the answer to your device problems are somewhere in that console log.

i just went through the steps you gave me, but nothing’s working. I don’t understand how to use command prompt and tether my phone, i tried it but nothing is happening lol. Can you help?

@Rob ok i reinstalled Corona, from the website. the simulator works fine but error still occur when my device runs the apk. how exactly do you see the device’s console log?? im confused

Isiah,

Here are some pages to check out:

http://developer.coronalabs.com/content/troubleshooting

http://www.coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Hope that helps get you started.

Make sure you read this important paragraph:

First, you have to install some free tools from Google called the Android Debug Bridge tools. For details on this, please see our Android Signing and Building guide and scroll to the “ Debugging” section at the bottom.

You have to install the tools, understand where they are and then run them.  If you plan on building for Android, this is a critical skill you have to learn.  Just because you don’t know your way around the command prompt now, doesn’t mean you shouldn’t put in the effort to learn it.  It’s not easy. 

Now that said, the single biggest problem to “It works in the sim but not the device” is a problem with case sensitivity of file names.  The simulator is not case sensitive while devices are.  So if you have an image named:

     levelbackground.png

but you try and load it:

    local bg = display.newImage(“levelBackground.png”)

(notice the capitalized “B”) the simulator will go about it’s merry way and load that image just fine.  On your device, it will error.  Without seeing your console log we can only make guesses as to what’s going on.   This is a critical skill you need to develop. 

One other thing you might want to consider.  On android  you can find apps that will show the device’s console log for you on the device.  This isn’t quite as good as watching the log as you try and run the app as you have to quit the app your debugging then switch apps, all along more stuff is going into the log, but it’s an option.

after hours and hours, lol, because im not familiar with terminal commands at all, I GOT IT TO WORK HAAAAHAAHAA! ok, so i even played my game through the phone and all print statements appeared, but its nothing different that what corona terminal shows me. didnt you say that if theres a problem then it must be in the console log?

the command i used was adb logcat Corona:v *:s from the link you gave me.

When i get up to a certain scene it displays the background kind of weird and malfunctions, but the command above didnt give me any error message, it just sort of stopped running lol. any suggestions

thanks for the help guys!

@Rob @thegdog

if anyone is thoroughly lost like I was, this link is LIFE.

http://www.youtube.com/watch?v=V0MyTvgfO7s

instead of using fastboot, just use ADB 

I/Adreno  ( 7207): ioctl code 0xc01c0915 (IOCTL_KGSL_MAP_USER_MEM) failed: errno 12 Out of memory

W/Adreno200-EGLSUB( 7207): <GetBackBuffer:1996>: failed to map the memory for fd=1519570904 offs=77

E/Adreno200-ES20( 7207): <gl2_surface_swap:41>: GL_OUT_OF_MEMORY

E/Adreno200-EGL( 7207): <qeglDrvAPI_eglSwapBuffers:3388>: EGL_BAD_ALLOC

These are the messages i got when the game crashed. oh my gooddd this is sooooooo coool!!! Thank you sooo much!

So if I’m out of memory, what are things that I can do to fix?

Without knowing more about your code, images and what you’re doing we can’t give you precise answers.

You could have a memory leak (most likely if it runs for a while and stops).  You could be loading really large images and letting Corona scale them down, taking up excessive memory.  

Google around for Corona and memory leaks.  You should find some code that will print out your memory usage which you can see in your console log that will help you determine what’s going on.  Keep in mind, your computer probably has 4-8GB of memory.  Your device is lucky to have 1GB so memory problems may not show up in the simulator.

Hi Isiah.  We need a bit more information to help you.  

What version of Corona SDK are you using?

Can you look at your device’s console log and see what error messages you are getting?  You might want to read this blog post:

http://www.coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

We need to know if anything is going on under the hood.  Besides helping you get that information, it’s has helpful other information that you can use to help determine the problems.  Also, make sure you’ve running the latest version and keep in mind if you had an older version (which the comments about the “Trial version” makes me think you have updated to a newer version) and have moved to a newer version, our API calls change over time and if you’ve not kept things up, it can lead to similar problems. 

But the answer to your device problems are somewhere in that console log.

i just went through the steps you gave me, but nothing’s working. I don’t understand how to use command prompt and tether my phone, i tried it but nothing is happening lol. Can you help?

@Rob ok i reinstalled Corona, from the website. the simulator works fine but error still occur when my device runs the apk. how exactly do you see the device’s console log?? im confused

Isiah,

Here are some pages to check out:

http://developer.coronalabs.com/content/troubleshooting

http://www.coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Hope that helps get you started.

Make sure you read this important paragraph:

First, you have to install some free tools from Google called the Android Debug Bridge tools. For details on this, please see our Android Signing and Building guide and scroll to the “ Debugging” section at the bottom.

You have to install the tools, understand where they are and then run them.  If you plan on building for Android, this is a critical skill you have to learn.  Just because you don’t know your way around the command prompt now, doesn’t mean you shouldn’t put in the effort to learn it.  It’s not easy. 

Now that said, the single biggest problem to “It works in the sim but not the device” is a problem with case sensitivity of file names.  The simulator is not case sensitive while devices are.  So if you have an image named:

     levelbackground.png

but you try and load it:

    local bg = display.newImage(“levelBackground.png”)

(notice the capitalized “B”) the simulator will go about it’s merry way and load that image just fine.  On your device, it will error.  Without seeing your console log we can only make guesses as to what’s going on.   This is a critical skill you need to develop. 

One other thing you might want to consider.  On android  you can find apps that will show the device’s console log for you on the device.  This isn’t quite as good as watching the log as you try and run the app as you have to quit the app your debugging then switch apps, all along more stuff is going into the log, but it’s an option.

after hours and hours, lol, because im not familiar with terminal commands at all, I GOT IT TO WORK HAAAAHAAHAA! ok, so i even played my game through the phone and all print statements appeared, but its nothing different that what corona terminal shows me. didnt you say that if theres a problem then it must be in the console log?

the command i used was adb logcat Corona:v *:s from the link you gave me.

When i get up to a certain scene it displays the background kind of weird and malfunctions, but the command above didnt give me any error message, it just sort of stopped running lol. any suggestions

thanks for the help guys!

@Rob @thegdog

if anyone is thoroughly lost like I was, this link is LIFE.

http://www.youtube.com/watch?v=V0MyTvgfO7s

instead of using fastboot, just use ADB 

I/Adreno  ( 7207): ioctl code 0xc01c0915 (IOCTL_KGSL_MAP_USER_MEM) failed: errno 12 Out of memory

W/Adreno200-EGLSUB( 7207): <GetBackBuffer:1996>: failed to map the memory for fd=1519570904 offs=77

E/Adreno200-ES20( 7207): <gl2_surface_swap:41>: GL_OUT_OF_MEMORY

E/Adreno200-EGL( 7207): <qeglDrvAPI_eglSwapBuffers:3388>: EGL_BAD_ALLOC

These are the messages i got when the game crashed. oh my gooddd this is sooooooo coool!!! Thank you sooo much!

So if I’m out of memory, what are things that I can do to fix?

Without knowing more about your code, images and what you’re doing we can’t give you precise answers.

You could have a memory leak (most likely if it runs for a while and stops).  You could be loading really large images and letting Corona scale them down, taking up excessive memory.  

Google around for Corona and memory leaks.  You should find some code that will print out your memory usage which you can see in your console log that will help you determine what’s going on.  Keep in mind, your computer probably has 4-8GB of memory.  Your device is lucky to have 1GB so memory problems may not show up in the simulator.