Scene doesn't show contents when built on android or iOS on certain machines

I have been building my first full game with corona over the past 2 months with no major issues (really love it!) but I’ve suddenly encountered this strange bug and I can’t tell how long it has been here.

I have, up until this week, done all development on my Windows 10 desktop and from here I can build signed and debug versions of the app to android perfectly fine.  

When I moved the project to my macbook and windows 10 laptop I found that the simulator runs exactly as expected but when testing on either my iphone or Nexus 6p I see that the code from my main.lua all runs and then I get a blank screen.

Here is a cut-down version of my main.lua:

local composer = require( "composer" ) -- Hide status bar display.setStatusBar( display.HiddenStatusBar ) display.setDefault( "background", 0.17, 0.24, 0.29 ) local splashBackground = display.newRect( display.contentCenterX, display.contentCenterY, 2\*display.contentWidth, 2\*display.contentHeight ) splashBackground:setFillColor(1) local splashLogo = display.newImageRect( "prlogo.png", display.contentCenterX\*2/3, display.contentCenterX\*2/3) splashLogo.x = display.contentCenterX splashLogo.y = display.contentCenterY ------------------------------------------------------------ TODO: Remove warning for public release builds------------------------------------------------------------------ native.showAlert( "Thank you for playing!", "Please remember this is a development build. You may find bugs which can be reported at ############################", {"I understand"}) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- composer.gotoScene( "menu" )

I can tell that my main.lua file runs as i have permanent debugText element there (with alpha usualy set to) which displays what I want there. The problem is that the elements that i create in scene:create() do not display (but i know it runs because i can change my debugText in that method).

Here is a cut-down version of the code in menu.lua

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()" -------------------------------------------------------------------------------------- local playButton local shopButton local shareButton local rateButton local highScoresButton local storeButton local pulseIconIn, pulseIconOut local trans local debugText --hide debug message local function hideDebug() transition.to( debugText, { time=200, delay=1000, alpha=0, y=0}) end --display debug message local function showDebug( string ) debugText.text = string transition.to( debugText, { time=200, alpha=1, y=display.contentHeight/20, onComplete=hideDebug}) end --debug Text with 0 alpha be default debugText = display.newText( "Coming soon!", display.contentCenterX, 0, "Bauhaus-93\_6274.ttf", (display.contentHeight-display.contentWidth)/8) debugText.alpha = 0 debugText:setFillColor(0) --------------------------------------------------------------------------------------------------------------------- -----Functions to control button clicks are here----- --------------------------------------------------------------------------------------------------------------------- ------HANDLE SYSTEM EVENTS------ local function onAccelerate( event ) shopButton.rotation = -event.xGravity\*100 shareButton.rotation = -event.xGravity\*100 rateButton.rotation = -event.xGravity\*100 highScoresButton.rotation = -event.xGravity\*100 storeButton.rotation = -event.xGravity\*100 end -- ----------------------------------------------------------------------------------- -- 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 local logo = display.newImageRect( sceneGroup, "logo.png", display.contentWidth, display.contentWidth ) logo.x = display.contentCenterX logo.y = display.contentCenterY / 3 playButton = display.newImageRect( sceneGroup, "play.png", display.contentCenterX/2, display.contentCenterX/2) playButton.x = display.contentCenterX playButton.y = display.contentCenterY playButton:addEventListener( "tap", gotoGame ) shopButton = display.newImageRect( sceneGroup, "shop-icon.png", display.contentWidth/8, display.contentWidth/8 ) shopButton.x = display.contentCenterX shopButton.y = display.contentHeight\*7/8 shopButton:addEventListener( "tap", gotoDevPage ) shareButton = display.newImageRect( sceneGroup, "share-icon.png", display.contentWidth/8, display.contentWidth/8 ) shareButton.x = display.contentCenterX - display.contentWidth/4 shareButton.y = display.contentHeight\*7/8 shareButton:addEventListener( "tap", shareApp ) rateButton = display.newImageRect( sceneGroup, "star-icon.png", display.contentWidth/8, display.contentWidth/8 ) rateButton.x = display.contentCenterX + display.contentWidth/4 rateButton.y = display.contentHeight\*7/8 rateButton:addEventListener( "tap", rateApp ) highScoresButton = display.newImageRect( sceneGroup, "score-icon.png", display.contentWidth/8, display.contentWidth/8 ) highScoresButton.x = display.contentCenterX - display.contentWidth/8 highScoresButton.y = display.contentHeight\*6/8 highScoresButton:addEventListener( "tap", displayHighScores ) storeButton = display.newImageRect( sceneGroup, "store-icon.png", display.contentWidth/8, display.contentWidth/8 ) storeButton.x = display.contentCenterX + display.contentWidth/8 storeButton.y = display.contentHeight\*6/8 storeButton:addEventListener( "tap", gotoShop ) Runtime:addEventListener( "accelerometer", onAccelerate ) 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 scree pulseIconIn( playButton ) 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 transition.cancel(trans) 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
  • I have ensured that the projects are identical by syncing the same repository on our bitbucket server.
  • I have tried building with the same corona build (2016.2830)
  • I have tried installing the same versions of JDK on both my desktop and laptop (7u79 AND 7u80)

Can anyone lend some ideas?

Are you checking the logcat printout for your Nexus or the Xcode debug log for you iPhone? They might give you information such as whether the project can’t find your image assets.

If you need help with that, see:
 

https://docs.coronalabs.com/guide/basics/debugging/index.html

Rob

Thank you!

I found this:

09-28 14:00:48.417  5032  5050 I Corona  : WARNING: Asset file “logo.png” does not exist.

09-28 14:00:48.417  5032  5050 I Corona  : WARNING: D:\Documents\ProbablyRational\Projects\Contain it!\menu.lua:143: Failed to find image ‘logo.png’

I checked and changed the case of logo.png which seems to have fixed it! not entirely sure why it worked on one machine but not on the other.

Thank’s for all the help!

Windows and macOS are not case sensitive. Android and iOS are. Having a case sensitivity issue with file names is the #1 cause of “It works in the simulator but not on the device.”

Rob

Are you checking the logcat printout for your Nexus or the Xcode debug log for you iPhone? They might give you information such as whether the project can’t find your image assets.

If you need help with that, see:
 

https://docs.coronalabs.com/guide/basics/debugging/index.html

Rob

Thank you!

I found this:

09-28 14:00:48.417  5032  5050 I Corona  : WARNING: Asset file “logo.png” does not exist.

09-28 14:00:48.417  5032  5050 I Corona  : WARNING: D:\Documents\ProbablyRational\Projects\Contain it!\menu.lua:143: Failed to find image ‘logo.png’

I checked and changed the case of logo.png which seems to have fixed it! not entirely sure why it worked on one machine but not on the other.

Thank’s for all the help!

Windows and macOS are not case sensitive. Android and iOS are. Having a case sensitivity issue with file names is the #1 cause of “It works in the simulator but not on the device.”

Rob