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

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

But I will change “just in case”

Hi Vlad, hi SGS,

I guess you couldn’t find any problems because the Google Team tested “Freeze! 2” against the Developer Preview of the upcoming Android 9.0 (Codename could be “Pie”, and they will give more info about this on March 14, because 3.14 = pi :slight_smile:  ).

With Android 8.x all was fine with the old code.

Best

Andreas

As I wrote on the other thread…

It should be:

if (system.getInfo("platform") == "Android")

instead of

if (system.getInfo("platformName") == "Android")

since platformName is deprecated.

Note that “platform” would return names in lower case.

So, actually it’s 

if system.getInfo("platform") == "android" then ... end

Cheers!

hey, I was just trying to add to the post, that navigation bar on Samsung Glxy S8 stays ON despite this code. Maybe this is the reason… 

Thanks, Vlad.

FWIW, 

system.getInfo("platformName")

still works.  The change to

system.getInfo("platform") == "android"

does add a complication in that it also returns true on sim so is not suitable for checking if on an actual device - for say ads initialisation.

@vlad, these values could be better exposed as properties, for example

if system.isAndroid then \<do something android\> elseif system.isIos then \<do something iOS\> elseif system.isSim then \<do something sim\> end

If I understand this correctly, this code is supposed to hide the navigation bar on devices with no physical buttons, correct?

I added the code on main.lua and it sort of works the first time but if I…

  1. go on the internet after that and I doubletap the dot on navigation bar so that navigation bar is always on

  2. close my app from previously active (opened) apps

  3. restart my app

the navigation bar is ON

is there something I should do differently or is this how it’s supposed to work?

If I open Mario Run for instance, the navigation bar always disappears.

@odisej you need to use the resize event

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

&nbsp;if( platform == "android" ) then local function onResize( event ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (system.getInfo("androidApiLevel") \>= 19) then &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;native.setProperty("androidSystemUiVisibility", "immersiveSticky") &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;native.setProperty("androidSystemUiVisibility", "lowProfile") &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end &nbsp; &nbsp;end &nbsp; &nbsp;Runtime:addEventListener( "resize", onResize ) &nbsp;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.