Hello!
I have encountered a problem with my app. My friends are also having a similar issue with their apps.
In Corona simulator the app works perfectly, but once it is compiled into an apk and run on a phone, the app doesn’t work. To be more specific; certain objects aren’t shown, like the background. The timer also doesn’t work.
Here are some images of the app working in Corona:
[spoiler]
The Help Screen:
[/spoiler]
The game not working on my Phone.
[spoiler]

The Help Screen:

[/spoiler]
Here is the main.lua file:
[spoiler]
--Author: Oliver Duce --App: Base Defend! --Date: 2015 --Define the variables rotateAmt = 5 rotateMin = -90 rotateMax = 40 turretRotation = 0 turretForce = 1000 playerPoints = 0 targetHit = false timeLeft = 500 --Define the functions function makeInterface( ) --up button upButton = display.newImage('up\_button.png', 30, 100) upButton:scale(0.3, 0.3) upButton:addEventListener('touch', moveUp) --down button downButton = display.newImage('down\_button.png', 30, 160) downButton:scale(0.3, 0.3) downButton:addEventListener('touch', moveDown) --fire button fireButton = display.newImage('fire\_button.png', 590, 130) fireButton:addEventListener('touch', fire) --display turret parts turretBase = display.newImage('turretB.png', 160, 300) turretBase:scale(0.2, 0.2) turretBarrel = display.newImage('turretTop.png', 162, 285) turretBarrel:scale(0.2, 0.2) turretBarrel.anchorX = 0.2335907335 turretBarrel.anchorY = 0.7861635220 --display score scoreDisplay = display.newText( ('Points: ' .. playerPoints), 330, -10, native.systemFont, 20 ) scoreDisplay:setFillColor( 0, 0, 255 ) scoreDisplay:translate(display.contentHeight /2, 30) --Show Help function showHelp( ) transition.to(helpScreen, {time = 500, y = helpScreen.height/2}) end --Hide Help function hideHelp( ) transition.to(helpScreen, {time = 500, y = -helpScreen.height}) end --Display the help button helpBtn = display.newImage('helpBtn.png', 590, 330) helpBtn:addEventListener ("tap", showHelp) --Display the graphic off screen helpScreen = display.newImage('helpScroll.png') helpScreen.x = 101 helpScreen.y = -helpScreen.height helpScreen:toFront() helpScreen:addEventListener('tap', hideHelp) end function update( ) --decrease the time counter timeLeft = timeLeft - 1 scoreDisplay.text = 'Points: ' .. playerPoints .. ' Time: ' .. timeLeft --check if the time has run out if (timeLeft \<= 0) then --display the final score scoreDisplay.text = 'Final Score: ' .. playerPoints --remove all of the screen objects display.remove(turretBase) display.remove(turretBarrel) display.remove(target) display.remove(upButton) display.remove(downButton) display.remove(fireButton) --display the 'game over' sign gameOver = display.newText("Game Over", 320, 180, native.systemFont, 50 ) gameOver:setFillColor( 255, 0, 0 ) end --check if the target has been hit if (targetHit == true) then targetHit = false playerPoints = playerPoints + 5 timeLeft = timeLeft + 100 Hit = display.newImage('hit.png', target.x--[[250]], target.y)--145 Hit:scale (0.3, 0.3) --replace the target with the hit picture transition.dissolve(Hit, target, 1000, 0) display.remove(bullet) --put the target back to a random position target.x = math.random(300, 500 ) target.y = math.random(50, 300 ) end end function onCollide(event) targetHit=true end function fire(event) --only fire at the beginning of a touch event if (event.phase == 'began') then media.playSound('bang.wav') bullet = display.newImage('cannonball.png') --move the image bullet.x, bullet.y = turretBarrel:localToContent(220, -30) bullet:scale(0.3, 0.3) bullet.rotation = turretRotation --apply physics to the turretball physics.addBody( bullet, { density=10.0, friction=10.0, radius=5 } ) --determine the appropriate ratio of horizontal to vertical force force\_x = math.cos(math.rad(turretRotation)) \* turretForce force\_y = math.sin(math.rad(turretRotation)) \* turretForce --fire the turretball bullet:applyForce( force\_x, force\_y, bullet.x, bullet.y ) end end function moveDown(event) --only move the barrel if the touch event started if (event.phase == 'began') then turretRotation = turretRotation + rotateAmt if (turretRotation \>= rotateMax) then turretRotation = rotateMax end turretBarrel.rotation = turretRotation fireButton.rotation = turretRotation end end function moveUp(event) --only move the barrel if the touch event started if (event.phase == 'began') then turretRotation = turretRotation - rotateAmt if (turretRotation \<= rotateMin) then turretRotation = rotateMin end turretBarrel.rotation = turretRotation fireButton.rotation = turretRotation end end function makeTarget( ) target = display.newImage('plane.png') target:scale(0.3, 0.3) target.x = math.random(300, 510) target.y = math.random(50, 220) physics.addBody(target,{density=1.0, friction=0.5, bounce=0.05, radius=25}) target.bodyType = 'static' target:addEventListener('collision', onCollide) end --Define control structure function init( ) display.setStatusBar(display.HiddenStatusBar) background = display.newImage('bg2.png', 320, 180) soundtrack = media.playSound('soundtrack.mp3', true) physics = require('physics') physics.setDrawMode('normal') physics.start( ) makeInterface( ) makeTarget( ) Runtime:addEventListener('enterFrame', update) end --Call the code init( )
[/spoiler]
Here is the config.lua:
[spoiler]
application = { content = { width = 360, height = 640, scale = "zoomStretch", fps = 60 } }
[/spoiler]
And finally, the build.settings:
[spoiler]
settings = { orientation = { default = "landscape", } }
[/spoiler]
How do I fix this? Help would be greatly appreciated!
Thank you,
-Oliver