Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7993851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:58:34+00:00 2026-06-04T13:58:34+00:00

I am currently writing a cross platform app using the CoronaSDK and Lua. I

  • 0

I am currently writing a cross platform app using the CoronaSDK and Lua. I am using the director package to change scenes. However I am getting the following error:

“Director ERROR: Failed to execute new(params) function on ‘startUp’.”

I know the error is coming from my main class. Which is:

-----------------------------------------------------------------------------------------
--
-- main.lua
--
-----------------------------------------------------------------------------------------

local director = require("director")
local mainGroup = display.newGroup()
splash = display.newImage("images/logo.png")

local main = function()

    splash:removeSelf()
    splash = nil
    mainGroup:insert(director.directorView)
    local widget = require "widget"

    -- show default status bar (iOS)
    display.setStatusBar(display.DefaultStatusBar)

    local mainGroup = display.newGroup()

    -- event listeners for tab buttons:
    local function onFirstView( event )
        director:changeScene("startUp")
    end

    local function onSecondView( event )
        director:changeScene("home")
    end

    -- table to setup buttons
    local tabButtons = {
        { label="Home", up="icon1.png", down="icon1-down.png", width = 32, height = 32, onPress=onFirstView, selected=true },
        { label="Cards", up="icon2.png", down="icon2-down.png", width = 32, height = 32, onPress=onSecondView },
    }

    -- create the actual tabBar widget
    local tabBar = widget.newTabBar{
        top = display.contentHeight,
        buttons = tabButtons
    }

    --I think it is this line which is causing the error
    director:changeScene("startUp")

    return true
end

timer.performWithDelay(3000, main, 1)

Here is my startUp.lua file:

module(..., package.seeall)

function new()
    require "sqlite3"
    local director = require("director")
    --Connect to database or create it.
    --Each user gets there own database****
    local path = system.pathForFile("data.db", system.DocumentsDirectory)
    local db = sqlite3.open(path)

    --Create the database table if it does not already exist
    local tablesetup = [[CREATE TABLE IF NOT EXISTS User (id Integer autoincrement PRIMARY KEY, firstname, lastname);]]
    db:exec(tablesetup)

    for row in db:nrows("SELECT * FROM User") do
        --goto home if the user is in the database.
        director.changeScene("home")
    end

    --If not in the database go to forms
    director.changeScene("forms")

    --Catch application Exit
    Runtime:addEventListener("system", onSystemEvent)

    --Handle application exit - close the database connection
    local function onSystemEvent(event)
        if(event.type == "applicationExit") then
            db:close()
        end
        print("database closed")
    end

end

Here is the error I get in the console:

Runtime Error director.lua:1092:attempt to call method 'insert' (a nil value) 
stack traceback: in function 'insert' in function 'changeScene'
---------------
Director Error: Failed to execute new(params) function on 'startUp'.
---------------
assertion failed
---------------
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:58:36+00:00Added an answer on June 4, 2026 at 1:58 pm

    The error is a director class error. It occurs because your startUp.lua has some errors.

    Are you using the latest director class(1.4)? The latest director class shows the ACTUAL ERROR as well.

    And not that files are case-sensitive. Your file must be startUp.lua and not startup.lua.

    EDIT:

    I can think of 2 things.

    1.Try changing director.changeScene to director:changeScene in 2 places in startUp.lua

    2.Try removing the second local mainGroup = display.newGroup() in main.lua (though I doubt this would be the prob)

    THE ACTUAL ERROR

    -----------------------
    Director ERROR: Failed to execute new( params ) function on 'wifiscreen'.
    -----------------------
    e:\corona\satheesh\doodle2\wifiscreen.lua:231: attempt to index global 'x' (a nil value)
    -----------------------
    

    The second line is the avtual error.

    ERROR FOUND I THINK

    I think the error is because you don’t have a onSystemEvent function.
    Generally assertion failed error occurs if you try to add listeners to non-existing functions!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently writing a simple cross platform app with Node.js on the server and
I'm considering writing a cross-platform desktop app, initially for Mac/Windows, but eventually for Linux
I am writing application in C# using GTK# GUI framework to make it cross-platform.
I'm currently writing a Java app that interfaces with a MySQL database. My problem
I'm currently writing myself a little C# back up program. I'm using a standard
I'm currently writing an app in Python and need to provide localization for it.
I'm currently writing an app in Android that works with the GPS. At the
I am currently writing a paper on the Android platform. After some research ,
I'm pretty new to C++ and am writing a cross-platform (desktop/mobile) 2D game engine...
I'm writing a cross platform datalogging application in C# so I use the .NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.