Solar2D App Shows Black Screen on Startup – How to Fix?

Hi everyone,

I recently built a game using Solar2D, but when I run it on my Android/iOS deviceor emulator, all I see is a black screen. The app doesn’t crash, but no visuals appear. I’ve checked my main.lua file, and there are no syntax errors.

Here’s what I have tried so far:
Verified that all image assets are correctly loaded and paths are correct.
Ensured my config.lua and build.settings files are properly set up.
Checked for missing plugins or dependencies.
Tested on both the Solar2D simulator and a real device, but the issue persists.

Could this be related to rendering issues, missing assets, or a runtime error? Has anyone else experienced this, and how did you resolve it?
Any help would be greatly appreciated! Thanks!

Hey @xirawa, could you share your config.lua, build.settings, and main.lua files?
You can always use print to display a message in the console. For example, in your first scene, so you can check whether it is loading correctly or not.

Also, I’m sharing a Solar2D scene template with all the events needed to manage the scene.

local composer = require( "composer" )

local scene = composer.newScene()

-- -----------------------------------------------------------------------------------
-- Code outside of the scene event functions below will only be executed ONCE unless
-- the scene is removed entirely (not recycled) via "composer.removeScene()"
-- -----------------------------------------------------------------------------------




-- -----------------------------------------------------------------------------------
-- Scene event functions
-- -----------------------------------------------------------------------------------

-- create()
function scene:create( event )

    local sceneGroup = self.view
    -- Code here runs when the scene is first created but has not yet appeared on screen

end


-- show()
function scene:show( event )

    local sceneGroup = self.view
    local phase = event.phase

    if ( phase == "will" ) then
        -- Code here runs when the scene is still off screen (but is about to come on screen)

    elseif ( phase == "did" ) then
        -- Code here runs when the scene is entirely on screen

    end
end


-- hide()
function scene:hide( event )

    local sceneGroup = self.view
    local phase = event.phase

    if ( phase == "will" ) then
        -- Code here runs when the scene is on screen (but is about to go off screen)

    elseif ( phase == "did" ) then
        -- Code here runs immediately after the scene goes entirely off screen

    end
end


-- destroy()
function scene:destroy( event )

    local sceneGroup = self.view
    -- Code here runs prior to the removal of scene's view

end


-- -----------------------------------------------------------------------------------
-- Scene event function listeners
-- -----------------------------------------------------------------------------------
scene:addEventListener( "create", scene )
scene:addEventListener( "show", scene )
scene:addEventListener( "hide", scene )
scene:addEventListener( "destroy", scene )
-- -----------------------------------------------------------------------------------

return scene

try to remark all lines of code in main.lua file

and just keep one line that shows any object that does not rely on resources like display text in the middle of the screen

and try it out to make sure that the problem is within your code or from something else

To build on what kakula said- try running one of the sample apps in the SampleCode folder in your Corona folder. If that works, you can rule out a system problem, and focus on finding out what’s going on with your code.