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

Hi,

the Google Android Developer Support Team just send me an email where they tell me that they tested “Freeze! 2” with the upcoming Android releases and that the game won’t work.

Well, let me first state that I think that it’s really very nice of Google that they test some games against their upcoming Android releases. :slight_smile:

This is their message:

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

We’ve discovered a bug specific to your application running on upcoming releases of Android. Please see the following details:

Application name: “Freeze! 2 - Brothers(com.frozengun.freeze2.google)”

Steps to reproduce the issue:

  1. Install “Freeze! 2 - Brothers” application from Play Store.

  2. Launch the application.

 

Observed Result(s):

The app shows a black screen.

 

Expected Result(s):

The app should be launched without any issues.

 

Possible Root Cause(s):

The app does not currently work on prerelease versions of the Android operating system due to assumptions on the value of the android.os.Build.VERSION.RELEASE string. 
The value of android.os.Build.VERSION.RELEASE may not always be a numeric value, so the app should not make such assumptions.

 

It is pretty atypical for apps to have issues like this, and it prevents us from finding platform issues that may impact your app, since they are masked by this problem.

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

From this message about “android.os.Build.VERSION.RELEASE” I guess that there is nothing I can do about it, that this needs to be handled from Coronalabs side. 

Any ideas?

Thanks & best

Andreas

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”

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.