Weird Android error?

Hi all, I decided to make a topic about this because I can’t seem to solve the issue here.

So, I have a fully functional and finished mobile game that is already out on the iOS App Store.

Now, the problem is that when build and played through android I get a weird runtime error which is the one in the file I attached. 

Now, I honestly don’t know much about android and its “things” because here the error I get is in Users/jenkins/slaveroot/android bla bla bla and it goes to a composer.lua file.

The error seems to be in the newImageSheet command I used (total of 2 times). 

The point is: everything works. It works in the simulator and it works on iOS. Why doesn’t it work on Android? 

The “width and height” values that I gave are okay, otherwise it wouldn’t even work in the simulator as this happened to me before.

So yeah, really I have no idea what the issue could be. Help would be appreciated. 

https://imgur.com/a/YLJDQTQ

Not something I’ve experienced myself, but I’m wondering if your spritesheet is too large. Android has a 2048x2048 limit as far as I understand from the imagesheet docs.

In case of these “weird bugs” that point to specific lines, it is usually helpful to provide at least some code so that we wouldn’t simply have to guess. :stuck_out_tongue:

Well, anyway, my guess is that you’ve mistyped it. The simulator isn’t case sensitive, and I don’t believe that iOS is either, but Android is. Check that the names match in your app’s folder and in your code.

those aren’t specific lines. The error is generated in a file I don’t have, it gets generated in the android device. My files.lua don’t exceed 1000 lines so that’s not even possible

{ width = 120, height = 215.0, numFrames = 92, } { width = 158, height = 143.75, numFrames = 20 } those are my NewImageSHeet #2 argument that points to the option. Here I see no problem, and the simulator and iOS are okay with that too

Have you tried it without the decimals, just to double check?

Yeah, decimals are impossible. Those width and height numbers represent pixels and you cannot realistically have a fraction of a pixel.

But, what I was referring to with the case sensitivity and the lines of code were the name(s) of your image sheet(s) and the lines where you load them and create the images with. For instance, let’s assume that you are trying to load the following image sheet:

local imageSheet = graphics.newImageSheet( “characterSheet.png”, options )

Now, if the image sheet’s actual name was “CharacterSheet.png”, i.e. capital C versus lowercase c, then non-case sensitive systems would still load it without problems. However, Android is case sensitive and having “C” instead of “c” in the filename means that the game won’t find the image sheet.

The easiest way to check that you don’t have any issues here is to just change the name of the file in the project folder to all lowercase and do the same in code. If it starts working, then you’ve found your problem.

Not something I’ve experienced myself, but I’m wondering if your spritesheet is too large. Android has a 2048x2048 limit as far as I understand from the imagesheet docs.

In case of these “weird bugs” that point to specific lines, it is usually helpful to provide at least some code so that we wouldn’t simply have to guess. :stuck_out_tongue:

Well, anyway, my guess is that you’ve mistyped it. The simulator isn’t case sensitive, and I don’t believe that iOS is either, but Android is. Check that the names match in your app’s folder and in your code.

those aren’t specific lines. The error is generated in a file I don’t have, it gets generated in the android device. My files.lua don’t exceed 1000 lines so that’s not even possible

{ width = 120, height = 215.0, numFrames = 92, } { width = 158, height = 143.75, numFrames = 20 } those are my NewImageSHeet #2 argument that points to the option. Here I see no problem, and the simulator and iOS are okay with that too

Have you tried it without the decimals, just to double check?

Yeah, decimals are impossible. Those width and height numbers represent pixels and you cannot realistically have a fraction of a pixel.

But, what I was referring to with the case sensitivity and the lines of code were the name(s) of your image sheet(s) and the lines where you load them and create the images with. For instance, let’s assume that you are trying to load the following image sheet:

local imageSheet = graphics.newImageSheet( “characterSheet.png”, options )

Now, if the image sheet’s actual name was “CharacterSheet.png”, i.e. capital C versus lowercase c, then non-case sensitive systems would still load it without problems. However, Android is case sensitive and having “C” instead of “c” in the filename means that the game won’t find the image sheet.

The easiest way to check that you don’t have any issues here is to just change the name of the file in the project folder to all lowercase and do the same in code. If it starts working, then you’ve found your problem.