Thanks Rob! Brent asked me to check out a problem the problem I was having, and I encountered the newText issue. Thank you for the confirmation! So good!
Hey Rob,
I’m having the same issue, only after the build 2131 it still appears not to work.
my logcat shows:
V/Corona ( 5050): > Class.forName: network.LuaLoader
V/Corona ( 5050): < Class.forName: network.LuaLoader
V/Corona ( 5050): Loading via reflection: network.LuaLoader
I/Corona ( 5050): Platform: SM-T210 / ARM Neon / 4.1.2 / GC1000 core / OpenGL ES 2.0
V/Corona ( 5050): > Class.forName: CoronaProvider.licensing.google.LuaLoader
V/Corona ( 5050): < Class.forName: CoronaProvider.licensing.google.LuaLoader
V/Corona ( 5050): Loading via reflection: CoronaProvider.licensing.google.LuaLoader
I/Corona ( 5050): Runtime error
I/Corona ( 5050): ?:0: attempt to index a nil value
I/Corona ( 5050): stack traceback:
I/Corona ( 5050): ?: in function <?:24>
I/Corona ( 5050): ?: in function ‘dispatchEvent’
I/Corona ( 5050): ?: in function ‘gotoScene’
I/Corona ( 5050): ?: in main chunk
except I don’t have any issues in that area…The Create scene function is line 24. In the Main.lua I only use a GotoStatment. Works like a charm on IOS, but android is bugging me. <_<
Samsung Tab 3 7 inch
CoronaSDK 2014.2187 2014.02.27
[lua]local storyboard = require “storyboard”
local scene = storyboard.newScene()
local json = require(“json”)
local mime = require( “mime” )
local widget = require(“widget”)
require “sqlite3”
local connection = require(“testconnection”)
local ads = require “ads”
local scalex = display.contentScaleX
local scaley = display.contentScaleY
local _W = display.contentWidth
local _W_2 = _W/2
local _H = display.contentHeight
local _H_2 = _H/2
local error_text
– Called when the scene’s view does not exist:
function scene:createScene( event )
local localGroup = self.view
local background = display.newImageRect( “backgrass.pngt”,900,1425 )
background.x = _W_2
background.y = _H_2
localGroup:insert( background )
local backgroundF = display.newImageRect( “WCheader.pngt”,800,200 )
backgroundF.x = _W_2
backgroundF.y = 100
localGroup:insert( backgroundF)
local Hand = display.newImageRect( “hand.pngt”,256,256 )
Hand.x = _W_2
Hand.y = _H-320
localGroup:insert( Hand)
local handtext = display.newText(“To keep the app free, please click the ad!”, 0,0, native.systemFont, 32);
handtext.x = _W_2
handtext.y = _H-440
handtext:setFillColor(1)
localGroup:insert( handtext )
end
[/lua]
The line 24 isn’t in your code. It’s in the storyboard module. You have a nil coming from somewhere where you are calling storyboard.gotoScene(). You didn’t post enough code to try and figure it out.
Rob
this is my main.lua, where I call on the login.lua or homescreen.lua depending on the user name present in the db.
hope this helps, If you need any more code please ask.
[lua]
– hide device status bar
display.setStatusBar( display.HiddenStatusBar )
– require controller module
local storyboard = require “storyboard”
require “sqlite3”
------------------
– Open DB connection
------------------
path = system.pathForFile(“data1.db”, system.DocumentsDirectory)
db = sqlite3.open( path )
tablesetup = [[CREATE TABLE IF NOT EXISTS usergeg (user_id, email);]]
db:exec( tablesetup )
query_user = [[SELECT * FROM usergeg]]
for col1 in db:urows(query_user)do
_G.curr_user = col1
end
if _G.curr_user == nil then
storyboard.gotoScene( “login” , “fade”, 50 )
else
storyboard.gotoScene( “homescreen” , “fade”, 50 )
end
[/lua]
I’ve also tried it with this code in my main.lua, and I got the same error on the android device’s catlog:
[lua]
– hide device status bar
display.setStatusBar( display.HiddenStatusBar )
– require controller module
local storyboard = require “storyboard”
require “sqlite3”
storyboard.gotoScene( “login” )
[/lua]
Hey Rob,
I’m having the same issue, only after the build 2131 it still appears not to work.
my logcat shows:
V/Corona ( 5050): > Class.forName: network.LuaLoader
V/Corona ( 5050): < Class.forName: network.LuaLoader
V/Corona ( 5050): Loading via reflection: network.LuaLoader
I/Corona ( 5050): Platform: SM-T210 / ARM Neon / 4.1.2 / GC1000 core / OpenGL ES 2.0
V/Corona ( 5050): > Class.forName: CoronaProvider.licensing.google.LuaLoader
V/Corona ( 5050): < Class.forName: CoronaProvider.licensing.google.LuaLoader
V/Corona ( 5050): Loading via reflection: CoronaProvider.licensing.google.LuaLoader
I/Corona ( 5050): Runtime error
I/Corona ( 5050): ?:0: attempt to index a nil value
I/Corona ( 5050): stack traceback:
I/Corona ( 5050): ?: in function <?:24>
I/Corona ( 5050): ?: in function ‘dispatchEvent’
I/Corona ( 5050): ?: in function ‘gotoScene’
I/Corona ( 5050): ?: in main chunk
except I don’t have any issues in that area…The Create scene function is line 24. In the Main.lua I only use a GotoStatment. Works like a charm on IOS, but android is bugging me. <_<
Samsung Tab 3 7 inch
CoronaSDK 2014.2187 2014.02.27
[lua]local storyboard = require “storyboard”
local scene = storyboard.newScene()
local json = require(“json”)
local mime = require( “mime” )
local widget = require(“widget”)
require “sqlite3”
local connection = require(“testconnection”)
local ads = require “ads”
local scalex = display.contentScaleX
local scaley = display.contentScaleY
local _W = display.contentWidth
local _W_2 = _W/2
local _H = display.contentHeight
local _H_2 = _H/2
local error_text
– Called when the scene’s view does not exist:
function scene:createScene( event )
local localGroup = self.view
local background = display.newImageRect( “backgrass.pngt”,900,1425 )
background.x = _W_2
background.y = _H_2
localGroup:insert( background )
local backgroundF = display.newImageRect( “WCheader.pngt”,800,200 )
backgroundF.x = _W_2
backgroundF.y = 100
localGroup:insert( backgroundF)
local Hand = display.newImageRect( “hand.pngt”,256,256 )
Hand.x = _W_2
Hand.y = _H-320
localGroup:insert( Hand)
local handtext = display.newText(“To keep the app free, please click the ad!”, 0,0, native.systemFont, 32);
handtext.x = _W_2
handtext.y = _H-440
handtext:setFillColor(1)
localGroup:insert( handtext )
end
[/lua]
The line 24 isn’t in your code. It’s in the storyboard module. You have a nil coming from somewhere where you are calling storyboard.gotoScene(). You didn’t post enough code to try and figure it out.
Rob
this is my main.lua, where I call on the login.lua or homescreen.lua depending on the user name present in the db.
hope this helps, If you need any more code please ask.
[lua]
– hide device status bar
display.setStatusBar( display.HiddenStatusBar )
– require controller module
local storyboard = require “storyboard”
require “sqlite3”
------------------
– Open DB connection
------------------
path = system.pathForFile(“data1.db”, system.DocumentsDirectory)
db = sqlite3.open( path )
tablesetup = [[CREATE TABLE IF NOT EXISTS usergeg (user_id, email);]]
db:exec( tablesetup )
query_user = [[SELECT * FROM usergeg]]
for col1 in db:urows(query_user)do
_G.curr_user = col1
end
if _G.curr_user == nil then
storyboard.gotoScene( “login” , “fade”, 50 )
else
storyboard.gotoScene( “homescreen” , “fade”, 50 )
end
[/lua]
I’ve also tried it with this code in my main.lua, and I got the same error on the android device’s catlog:
[lua]
– hide device status bar
display.setStatusBar( display.HiddenStatusBar )
– require controller module
local storyboard = require “storyboard”
require “sqlite3”
storyboard.gotoScene( “login” )
[/lua]