Everything well on simulator but runtime error on device

Hello everyone,

Everything goes well on simulator no error atall but after building when I run it on device it gives me a runtimeError which says “badargument #1 to ‘newSprite’(imagesheet expected got nil)” .

What I think is with the apk the imagesheet is not getting moved to the device because the size of the apk built in folder Corona App Builts is somewhere around 7Mb but when I move that same apk to my device the size of the apk is getting reduced by 200kbs which is the size of imagesheet.

Can anyone tell why this might be happening.

I am also attaching the pic of error.

Please see if any help can be provided.

Thanks and Regards,

Swanand Thakur

Nope.  All your files are getting moved unless you made a weird rule in your build.settings file.

Check the spelling and case of your image file names.  They must match exactly.

i.e. If you have a file name “billy.png”  and refer to it in code as “Billy.png”, it will work on your PC/Mac because those machines are not case-sensitive.  However, Android and iOS are case sensitive so this will fail.

You are probably incorrectly spelling the sprite image name.

Note: There should be a warning in your console when you run in the simulator.

Also, if you don’t know how to use ADB please check it out.  That will help you debugging stuff like this.

https://docs.coronalabs.com/guide/basics/debugging/index.html#device-debugging-android

( AFTER CHECKING ABOVE )

If none of those things is true, zip up your project and link it here.  Seeing just your code won’t help us.  We need to see the code and files.

Hello Sir @roaminggamer,

Sir that’s where I am surprised, because there is no warning getting print up their in console when I am running my program, the first thing I did was checking the name of the files but when it was ok I posted here in forums.

Sir then can you please explain why the size of apk is getting reduced when its been moved to device.

Regards,

Swanand Thakur.

  1. No need to refer to me as sir.  Just the handle is enough to be sure I know you’re talking to me.

  2. I’m about to go offline. (Note: I’m not employee in case there is any confusion; I’m just a guy who sometimes answers questions and I need to get back to earning $).

  3. Don’t forget to link your project here if you can’t solve the issue.  Folks will have a hard time helping with this otherwise.

Sir @roaminggamer,

That’s Sir is respect from my side to your experience and knowledge in this field. Anyways I will surely take your advice in consideration. The problem is solved I tried the last thing by renaming file.png and i don’t know how but it worked

Regards,

Swanand Thakur

Hi, 

I use texturepacker for my spritesheet needs.

Its not free but it makes my life easier so I find it worth it.

There are also free versions out there, in fact I think roaminggamer published something in the marketplace for using those not long time ago, but texturepacker is probably the easiest way to handle spritesheets.

Nope.  All your files are getting moved unless you made a weird rule in your build.settings file.

Check the spelling and case of your image file names.  They must match exactly.

i.e. If you have a file name “billy.png”  and refer to it in code as “Billy.png”, it will work on your PC/Mac because those machines are not case-sensitive.  However, Android and iOS are case sensitive so this will fail.

You are probably incorrectly spelling the sprite image name.

Note: There should be a warning in your console when you run in the simulator.

Also, if you don’t know how to use ADB please check it out.  That will help you debugging stuff like this.

https://docs.coronalabs.com/guide/basics/debugging/index.html#device-debugging-android

( AFTER CHECKING ABOVE )

If none of those things is true, zip up your project and link it here.  Seeing just your code won’t help us.  We need to see the code and files.

Hello Sir @roaminggamer,

Sir that’s where I am surprised, because there is no warning getting print up their in console when I am running my program, the first thing I did was checking the name of the files but when it was ok I posted here in forums.

Sir then can you please explain why the size of apk is getting reduced when its been moved to device.

Regards,

Swanand Thakur.

  1. No need to refer to me as sir.  Just the handle is enough to be sure I know you’re talking to me.

  2. I’m about to go offline. (Note: I’m not employee in case there is any confusion; I’m just a guy who sometimes answers questions and I need to get back to earning $).

  3. Don’t forget to link your project here if you can’t solve the issue.  Folks will have a hard time helping with this otherwise.

Sir @roaminggamer,

That’s Sir is respect from my side to your experience and knowledge in this field. Anyways I will surely take your advice in consideration. The problem is solved I tried the last thing by renaming file.png and i don’t know how but it worked

Regards,

Swanand Thakur

Hi, 

I use texturepacker for my spritesheet needs.

Its not free but it makes my life easier so I find it worth it.

There are also free versions out there, in fact I think roaminggamer published something in the marketplace for using those not long time ago, but texturepacker is probably the easiest way to handle spritesheets.