I have this code, which should create file with argument if app is running for the first time.
file = io.open("config.txt", "r") if file == nil then local t = { ["scoreNum"] = 0, ["tableOfNum"] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, ["highScore"] = 0} file:write(tostring(json.encode( t ))) file:close() else file:close() end
In Corona simulator I had no problem with this code, everything works well, but after building project I had this: “attempt to index local ‘file’ (a nil value)” in line file:write(tostring(json.encode( t )))
Also I tried to change the build.settings file (line below) but it did not help
android = { usesPermissions = { "android.permission.MANAGE\_DOCUMENTS", }, },
What am I doing wrong?
(sorry for my English if something do not understand - write
можно написать на русском, но на всякий случай продублируйте на Английском, вдруг админам не понравится)