getInfo("androidApiLevel") >= 23 results in "attempt to compare number with nil" Runtime Error

// edit: Turns out reason was I had changed “view as” in simulator from “iPhone 6”  to “Samsung Galaxy S5”. Didnt know that had any impacts on simulator apart from changing the look. Lesson learned :slight_smile:

Dear Corona community,

weird things going on here: Until yesterday my app worked fine, but this morning I get the following message when I try to run in simulator:

setupProfile.lua:483: attempt to compare number with nil

In my setupProfile.lua, line 483 is this:

if ( system.getInfo( “platform” ) == “android” and system.getInfo( “androidApiLevel” ) >= 23) then

so, as far as I understand, system.getInfo(“androidApiLevel”) returns nil, which kind of makes sense on my simulator. But why did that work until yesterday? Am I missing something?

Thanks

Yes, it is expected behavior. 

https://docs.coronalabs.com/api/library/system/getInfo.html#platform

In the Corona Simulator, the value returned depends on the skin selected, allowing you to test platform-dependent logic by changing skins.

Yes, it is expected behavior. 

https://docs.coronalabs.com/api/library/system/getInfo.html#platform

In the Corona Simulator, the value returned depends on the skin selected, allowing you to test platform-dependent logic by changing skins.