When running on Android device: Runtime error attempt to index a nil value

I have this project that does not seem to work when I build it for Android and run it on a device.

When I run it, I see the following logcat:

V/Corona  (22426): > Class.forName: network.LuaLoader

V/Corona  (22426): < Class.forName: network.LuaLoader

V/Corona  (22426): Loading via reflection: network.LuaLoader

I/Corona  (22426): Platform: GT-I9300 / ARM Neon / 4.3 / Mali-400 MP / OpenGL ES

 2.0 / 2015.2570

V/Corona  (22426): > Class.forName: CoronaProvider.licensing.google.LuaLoader

V/Corona  (22426): < Class.forName: CoronaProvider.licensing.google.LuaLoader

V/Corona  (22426): Loading via reflection: CoronaProvider.licensing.google.LuaLo

ader

I/Corona  (22426): Runtime error

I/Corona  (22426): ?:0: attempt to index a nil value

I/Corona  (22426): stack traceback:

I/Corona  (22426):      ?: in main chunk

I/Corona  (22426):      [C]: in function ‘require’

I/Corona  (22426):      /Users/jenkins/slaveroot/workspace/Templates/label/andro

id/platform/resources/init.lua:820: in function ‘require’

I/Corona  (22426):      ?: in main chunk

Even when I completely clear out my main.lua (so there’s nothing in it, and nothing gets loaded) I still get this error. I’m not sure where to start looking. I thought there was an issue in one or more of my lua files in the project but with an empty main.lua (so without any “require” statements) my other lua file are not loaded are they?

Anyone got a good suggestion where to start looking?

Thanks!

What does your build.settings file look like?

Here’s my build.settings:

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", supported = { "portrait", "portraitUpsideDown"}, }, iphone = { plist = { UIViewControllerBasedStatusBarAppearance = true, UIStatusBarHidden = true, UIPrerenderedIcon = false, -- set to false for "shine" overlay UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", "Icon-Small.png", "Icon-Small@2x.png" }, } }, android = { usesPermissions = { "android.permission.WRITE\_EXTERNAL\_STORAGE", "android.permission.INTERNET", --optional permission used to display current location via the GPS "android.permission.ACCESS\_FINE\_LOCATION", --optional permission used to display current location via WiFi or cellular service "android.permission.ACCESS\_COARSE\_LOCATION", }, usesFeatures = { { name = "android.hardware.screen.portrait", required = false }, { name = "android.hardware.screen.landscape", required = false }, { name = "android.hardware.location", required = false }, { name = "android.hardware.location.gps", required = false }, { name = "android.hardware.location.network", required = false }, }, -- required to handle large images largeHeap = true, }, }

Anyone got any pointers?

Hi @springmorning,

Well, I’ve never seen “android.hardware.screen.portrait” or “android.hardware.screen.landscape” used before, but I’m not sure why that would be causing the error.

If you take this build.settings file and copy it over the one in our sample “Hello World” app (save a copy of the original before you do, just in case), does the same error occur?

Brent

What does your build.settings file look like?

Here’s my build.settings:

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", supported = { "portrait", "portraitUpsideDown"}, }, iphone = { plist = { UIViewControllerBasedStatusBarAppearance = true, UIStatusBarHidden = true, UIPrerenderedIcon = false, -- set to false for "shine" overlay UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", "Icon-Small.png", "Icon-Small@2x.png" }, } }, android = { usesPermissions = { "android.permission.WRITE\_EXTERNAL\_STORAGE", "android.permission.INTERNET", --optional permission used to display current location via the GPS "android.permission.ACCESS\_FINE\_LOCATION", --optional permission used to display current location via WiFi or cellular service "android.permission.ACCESS\_COARSE\_LOCATION", }, usesFeatures = { { name = "android.hardware.screen.portrait", required = false }, { name = "android.hardware.screen.landscape", required = false }, { name = "android.hardware.location", required = false }, { name = "android.hardware.location.gps", required = false }, { name = "android.hardware.location.network", required = false }, }, -- required to handle large images largeHeap = true, }, }

Anyone got any pointers?

Hi @springmorning,

Well, I’ve never seen “android.hardware.screen.portrait” or “android.hardware.screen.landscape” used before, but I’m not sure why that would be causing the error.

If you take this build.settings file and copy it over the one in our sample “Hello World” app (save a copy of the original before you do, just in case), does the same error occur?

Brent