Got message from Android Developer Support Team: "Freeze! 2" won't run on "upcoming releases of Android"

@odisej you need to use the resize event

sorry Sphere - I believe I misunderstood earlier…I do use this code:

 if( platform == "android" ) then local function onResize( event )                 if (system.getInfo("androidApiLevel") \>= 19) then                    native.setProperty("androidSystemUiVisibility", "immersiveSticky")                  else                    native.setProperty("androidSystemUiVisibility", "lowProfile")                 end    end    Runtime:addEventListener( "resize", onResize )  end

You probably want to call the native.setProperty() functions in your main.lua outside of a resize event.  The resize event is to call code that will reshape your app’s display elements. For instance if you have buttons at the bottom of your screen where the nav bar was, when it hides, you might want to move those buttons down a few pixels to fill the space.  That would happen inside the resize event.

Rob

@Rob you are correct.  You must first do it main.lua but then also in resize()

This needs to be done in resize event too as that is fired after an ad is shown / browse internet to force the virtual bar to hide again.

I use this

local function onResize( event ) if \_isAndroid then if (system.getInfo("androidApiLevel") or 0) \>= 19 then native.setProperty("androidSystemUiVisibility", "immersiveSticky") else native.setProperty("androidSystemUiVisibility", "lowProfile") end end --recalculate our new screen constants \_originX, \_originY = display.screenOriginX, display.screenOriginY \_W, \_H = display.actualContentWidth, display.actualContentHeight \_centreX, \_centreY = \_W/2, \_H/2 --move the UI if isDisplayObject(uiTopButtons) then uiTopButtons.y = \_originY end if isDisplayObject(uiBottomButtons) then uiBottomButtons.y = \_originY + \_H - 30 end end

Thanks to both. Rob’s answer did the trick.

this was giving me an error:

if (system.getInfo("androidApiLevel") or 0) \>= 19 then

this is ok

if ((system.getInfo("androidApiLevel")) or 0) \>= 19 then

The first line is missing an opening (.

Rob

Hey Andreas

That’s nice of them!  

Can I ask why the android version is important to your game?  What changes does your game make on differing Android versions?

Hey back,

it’s not important to the game, I don’t do anything with this value, don’t read it, don’t write it. That’s the reason why I think this needs to be taken care of by Coronalabs.

All I set for the manifest is 

– Minimum is Android 4.1 

minSdkVersion = “16”,

Best from Munich

Andreas

Have you tried this? https://support.google.com/googleplay/android-developer/answer/7002270

It is very useful for testing a wide range of Android devices and OS versions.

I asked Engineering about this, but it may take a few days to get a response.

Rob

I have not received this informational message on my games and prelaunch testing shows zero issues on Android 8+ devices so I don’t think it is a Corona issue.  Are you sure you are not doing any conditional processing on a getInfo() function somewhere?

Manifest wise, the only difference is I use minSdkVersion = “15”.

Hey! Do they specify version of Android they’re using for testing? Or is there a traceback of any sort?
 
This is extremely confusing, since android.os.Build.VERSION.RELEASE is a string according to documentation.
And only place I see it used, is in system.getInfo(“platformVersion”) and it is returned without any conversions. I will try downloading android beta 8.1 and running some samples.

P.S.

[member=‘Avlepel’], may I humbly ask to PM a promo code for game in question, in case my test run OK?

UPDATE:

I don’t have any betas available for my Pixel tablet, so I don’t really know how to test it. From what I know, beta releases they do have beta attached to the version (like 8.1b2), but I couldn’t find any places we’re trying to parse it. It would be really nice to get more info, like a crash stack or something similar.

Hi Vlad,

thanks for looking into this! 

I looked into my code, and well, I do read this value and act on it:

function myResizeViewport() if (system.getInfo("platformName") == "Android") then local androidVersion = string.sub(system.getInfo("platformVersion"), 1, 3) if (androidVersion and tonumber(androidVersion) \>= 4.4) then native.setProperty("androidSystemUiVisibility", "immersiveSticky") elseif (androidVersion) then native.setProperty("androidSystemUiVisibility", "lowProfile") end end end myResizeViewport()

I added this a few years ago, before Google featured the game they told me that I have to take care of a problem on the NEXUS 9, there (only sometimes, I love this) there was a black bar at the bottom of the screen.

This fix fixed it - why I cannot exactly tell.

The interesting thing is the question why because of this only a black screen is shown.

If the result for “androidVersion” is bad there is no crash, because I check for “androidVersion” being ok.

And if no number >= 4.4 is found I go for 

native.setProperty(“androidSystemUiVisibility”, “lowProfile”)

Maybe this causes the black screen? But why? This is from the Coronalabs documentation:

  • “lowProfile” — Only on Android Ice Cream Sandwich (Api 14) or above. Dims the navigation bar icons. 

Shouldn’t make any trouble. Any ideas?

Vlad, I did send you a promo code via the Coronalabs message system, if you need it or not. :slight_smile:

Best,

Andreas

So, issue is resolved? I would suggest using system.getInfo(“androidApiLevel”)

I use identical code

--hide UI bar on android if system.getInfo("platformName") == "Android" then local androidVersion = string.sub(system.getInfo("platformVersion"), 1, 3) if (androidVersion and tonumber(androidVersion) \>= 4.4) then native.setProperty("androidSystemUiVisibility", "immersiveSticky") elseif (androidVersion) then native.setProperty("androidSystemUiVisibility", "lowProfile") end end

and have no warning on my games.  

The only potential issue would be tonumber(androidVersion) but that should be trapped by Lua errorhandling and not cause a failure in your code.  Unless of course you are not handling global errors?

If I understand the original question correctly, Google is testing Freeze2 on an upcoming release of Android. I doubt very seriously that most developers will see this warning unless you’re part of that test suite or until after this new version of Android hits the streets.

I would agree with @vlads in that getting the API level will always be numeric where platformVersion could return a string like 2.2.3.

Rob

Hi Vlad, Rob & SGS,

thanks for your time and input!

I just released “Freeze! 2” version v1.18 (118) with the suggested change, this is the much safer solution:

function myResizeViewport() if (system.getInfo("platformName") == "Android") then if (system.getInfo("androidApiLevel") \>= 19) then native.setProperty("androidSystemUiVisibility", "immersiveSticky") else native.setProperty("androidSystemUiVisibility", "lowProfile") end end end

It might take a few hours till the new version is available worldwide.

I will ask the Google engineers to look at the new version and to test again. And then I will keep you informed about the results.

Best from Munich

Andreas

Hi,

got a message from the Google Team:

====================

Hi,

Thanks for looking into the issue.

We have tried the latest version of the app(1.18) and can confirm that it works fine.

Thanks!

Android Developer Support Team

====================

So, good news, whoever is doing stuff like I did with the platformVersion should switch to androidApiLevel instead.

@Vlad: Thanks

Best

Andreas

Curious, I still use system.getInfo(“platformVersion”) and I have no errors like you have described

But I will change “just in case”