Things that work in the simulator/Windows build don't work in the Android build

First of all, orientation. Despite my config.lua specifying landscape, and the app displaying in landscape just fine on Windows, it still shows as portrait on Android. Am I missing something besides this code:

        orientation =

        {

                default = “landscapeLeft”,

                supported =

                {

                        “landscapeLeft”,

                        “landscapeRight”

                }

        }

Another problem is a local object showing as nil on Android but gets processed just fine on Windows. The code looks like this:

        local cat = display.newImage(“cat.png”, 800, 800 )

        cat:scale(.25,.25)

In the simulator and in the Windows build, the cat is shown scaled properly. But on Android I get “Runtime Error” “attempt to index local ‘cat’ (a nil value)” as shown in the attached picture. 

All help/ideas are appreciated. 

Check the case of “cat.png”.  Is it all lower case?  If the file name doesn’t match exactly it won’t work on devices.

Also, why not use newImageRect()?  I never use newImage() unless I do not know the size of the image in advance.

Orientation code always goes in build.settings not config.lua. There could also be syntax errors in your android table that might cause the build.settings to process incorrectly.

Please post both your build.settings and config.lua file.

Ed’s on spot with checking on cat.png.

One last point, unless you’re using an IDE that’s consuming Corona Simulator’s output, there should be a console window that opens behind the simulator. It’s always best to copy/paste error messages from that window rather than doing a screen shot and uploading it.

Thanks a lot guys! You were both right. Everything’s working properly now. :slight_smile:

Check the case of “cat.png”.  Is it all lower case?  If the file name doesn’t match exactly it won’t work on devices.

Also, why not use newImageRect()?  I never use newImage() unless I do not know the size of the image in advance.

Orientation code always goes in build.settings not config.lua. There could also be syntax errors in your android table that might cause the build.settings to process incorrectly.

Please post both your build.settings and config.lua file.

Ed’s on spot with checking on cat.png.

One last point, unless you’re using an IDE that’s consuming Corona Simulator’s output, there should be a console window that opens behind the simulator. It’s always best to copy/paste error messages from that window rather than doing a screen shot and uploading it.

Thanks a lot guys! You were both right. Everything’s working properly now. :slight_smile: