Corona SDK and Android 4.4

Since i’have updated my galaxy s4 to android 4.4 kit kat, my application does not load the buttons (widget.newButton), but it does in the simulator.

there may be some connection?

My apps work well on Nexus 7 running 4.4. Suggest some console troubleshooting to see what’s going on. If I had to bet I would say perhaps the Android widgets theme file is not loading for some reason.

EDIT : Ah I remember, there is no @4x Android Widget File included in the builtin widgets. If your device requires the @4x then you would have this problem. Few ways you can fix this until Corona Labs include the @4x files… 

The following is a little hack to get around this but it will mean no @4x files will load in case you supply them for other UI elements of your app. 

Open config.lua and find the section that looks like this for Android : 

            imageSuffix = 

            {

                ["@2x"] = 1.5,

                ["@4x"] = 3.0,

change than @4x to @2x so now both lines have @2x in it. Save and run your app on device and see if this worked. 

Good luck. 

Hey @ksan. Are you sure about that problem with @4x?  I have a game here configured to use @4x but I don’t have all the @4x images… I don’t have seen any problem… I thought that Corona would realize that the @4x does not exist and use the @2x

I think with general display.newImageRect calls it does go down to @2x if it can’t find the @4x files. The problem I observed was with the widgets specifically and I think it still was working but complaining none the less. Since @fbocciolesi mentioned a problem with the widgets on his Android 4.4 I thought this might be related. Long shot I realize.

Ok… I think the images that I don’t have I am usually calling using imageRect, so may be that also… Well, good to know that info anyway because if that problem happens to me I already know where to start to fix… thanks!

My pleasure. Besides, Alex promised those @4x files so hopefully this issue will go away soon. 

The @4x thing for Android is just a warning and it falls back to use the @2x assets.

@fbocciolesi are you seeing any errors in your console log on your device?  If you don’t know how to look at that log please read this tutorial:http://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

the @4x thing doesn’t work. 

@rob

the console il clear, not even an error.

in the simulator the application  works correctly.

What does your config.lua look like?

is the default one,

application = {

    content = {

        width = 320,

        height = 480, 

        scale = “letterBox”,

        xAlign = “center”,

        yAlign = “center”,

        fps = 30,

        

        --[[

        imageSuffix = {

            ["@2x"] = 2,

        }

    

    },

    --[[

    – Push notifications

    notification =

    {

        iphone =

        {

            types =

            {

                “badge”, “sound”, “alert”, “newsstand”

            }

        }

    }

    --]]    

}

You have the dynamic support commented out and you don’t have support for @4x resources either:

–[[

        imageSuffix = {

            ["@2x"] = 2,

        }

   

maybe try:

        imageSuffix = {

            ["@2x"] = 2,

            ["@4x"] = 4,
        }

   

alredy tried, 

i’ve commented out the dynamic support when i restore the config.lua to default.

Found the problem,

if in “widget.newButton” i declare the font “native.systemFont”

the app work in the simulator but it doesn’t in my galaxy s4.

without the font the app work properly.

My apps work well on Nexus 7 running 4.4. Suggest some console troubleshooting to see what’s going on. If I had to bet I would say perhaps the Android widgets theme file is not loading for some reason.

EDIT : Ah I remember, there is no @4x Android Widget File included in the builtin widgets. If your device requires the @4x then you would have this problem. Few ways you can fix this until Corona Labs include the @4x files… 

The following is a little hack to get around this but it will mean no @4x files will load in case you supply them for other UI elements of your app. 

Open config.lua and find the section that looks like this for Android : 

            imageSuffix = 

            {

                ["@2x"] = 1.5,

                ["@4x"] = 3.0,

change than @4x to @2x so now both lines have @2x in it. Save and run your app on device and see if this worked. 

Good luck. 

Hey @ksan. Are you sure about that problem with @4x?  I have a game here configured to use @4x but I don’t have all the @4x images… I don’t have seen any problem… I thought that Corona would realize that the @4x does not exist and use the @2x

I think with general display.newImageRect calls it does go down to @2x if it can’t find the @4x files. The problem I observed was with the widgets specifically and I think it still was working but complaining none the less. Since @fbocciolesi mentioned a problem with the widgets on his Android 4.4 I thought this might be related. Long shot I realize.

Ok… I think the images that I don’t have I am usually calling using imageRect, so may be that also… Well, good to know that info anyway because if that problem happens to me I already know where to start to fix… thanks!

My pleasure. Besides, Alex promised those @4x files so hopefully this issue will go away soon. 

The @4x thing for Android is just a warning and it falls back to use the @2x assets.

@fbocciolesi are you seeing any errors in your console log on your device?  If you don’t know how to look at that log please read this tutorial:http://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

the @4x thing doesn’t work. 

@rob

the console il clear, not even an error.

in the simulator the application  works correctly.