I have the following code:
local path
if display.contentScaleY == 2 then
path = “assets.intro-ready.retina.”
else
path = “assets.intro-ready.regular.”
end
local introLogoSheetInfo = require(path…“logo.logo”)
Under simulator it runs ok.
Under coronacards on iOS, I get this runtime error:
2015-02-02 23:38:16.710 Cucubes[92950:9454987] Platform: iPad Simulator / x86_64 / 8.1 / Apple Software Renderer / OpenGL ES 2.0 APPLE-10.1.5 / 2014.2511
2015-02-02 23:38:16.869 Cucubes[92950:9454987] Runtime error
module ‘assets.intro-ready.regular.logo.logo’ not found:
no field package.preload[‘assets.intro-ready.regular.logo.logo’]
no file ‘/Users/max/Library/Developer/CoreSimulator/Devices/2DAAE2FF-5D38-4111-A15A-F8AC61A916D8/data/Containers/Bundle/Application/DCE1A988-991A-4BF5-ADDC-62594A3BC303/Cucubes.app/assets.intro-ready.regular.logo.logo.lua’
no file ‘/Users/max/Library/Developer/CoreSimulator/Devices/2DAAE2FF-5D38-4111-A15A-F8AC61A916D8/data/Containers/Bundle/Application/DCE1A988-991A-4BF5-ADDC-62594A3BC303/Cucubes.app/assets.intro-ready.regular.logo.logo.lua’
no file ‘./assets.intro-ready.regular.logo.logo.so’
no file ‘/Users/max/Library/Developer/CoreSimulator/Devices/2DAAE2FF-5D38-4111-A15A-F8AC61A916D8/data/Containers/Bundle/Application/DCE1A988-991A-4BF5-ADDC-62594A3BC303/Cucubes.app/assets.intro-ready.regular.logo.logo.so’
no file ‘./assets.so’
no file '/Users/max/Library/Developer/CoreSimulator/Devices/2DAAE2FF-5D38-4111-A15A-F8AC61A916D8/data/Containers/Bundle/Application/DCE1A988-991A-4BF5-ADDC-62594A3BC303/Cucubes.app/assets.so’assets.intro-ready.regular.logo.logo
stack traceback:
[C]: in function ‘require’
?: in function ‘require’
As we can see, it does not translate dots to slashes.
I have tried to replace dots with slashes in lua code, and got this:
2015-02-03 00:00:37.173 Cucubes[93028:9464276] Runtime error
Error calling ‘require(“assets/intro-ready/regular/logo/logo”)’. Lua requires package names to use ‘.’ as path separators, not ‘/’. Replace the ‘/’ characters with ‘.’ and try again.
So, how do I fix it?
Thank you, Denis