Event listener objects not visible on android device

Hi Experts,
 
This is my first time using corona for android and have hit a show stopper. I am using storyboard to build a game involving multiple sprites and dynamic objects. The game works good on corona inbuilt simulator but when I transfer the apk to android device ( google nexus) all dynamic elements tied to listeners ( enterframe, touch, tap etc) are not ‘showing’ on the screen. Although background, and other ‘static’ objects are visible on device which are not manipulated by any event listeners.  ( I have used screengroup for all objects, so no issues there.)
 
I know it’s a small problem but after 3 days of head scratching I would like to ask your views on this. I reckon there is a problem with enterscene module where I am declaring all event listeners. But it works when tested in corona simulator.

 
Any help or direction for investigation will be appreciated.
 
 
Many thanks,
Vibhu

Pseudo code to understand the problem:

background and staticObject is visible on screen whereas ship is not visible

[lua]function scene:createScene( event )
local group = self.view

bg = display.newImage(“background.png”)
group:insert(bg)

staticObject = display.newImage(“example.png”)
group:insert(staticobject)

ship = display.newImage(“ship.png”)
physics.addBody(ship, “dynamic”, { friction=0.5, bounce=0.3 }
group:insert(ship)

function myListener()

–apply upward force on ship

end

function scene:enterScene( event )
local group = self.view

Runtime:addEventListener( “enterFrame”, myListener )

[/lua]

Hello Vibhu,

Most likely there is a device-specific error that is occurring which is halting the program, although it may appear to be running just fine. Can you please explore the debugging options presented in this post?

http://www.coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Thanks,

Brent Sorrentino

Pseudo code to understand the problem:

background and staticObject is visible on screen whereas ship is not visible

[lua]function scene:createScene( event )
local group = self.view

bg = display.newImage(“background.png”)
group:insert(bg)

staticObject = display.newImage(“example.png”)
group:insert(staticobject)

ship = display.newImage(“ship.png”)
physics.addBody(ship, “dynamic”, { friction=0.5, bounce=0.3 }
group:insert(ship)

function myListener()

–apply upward force on ship

end

function scene:enterScene( event )
local group = self.view

Runtime:addEventListener( “enterFrame”, myListener )

[/lua]

Hello Vibhu,

Most likely there is a device-specific error that is occurring which is halting the program, although it may appear to be running just fine. Can you please explore the debugging options presented in this post?

http://www.coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Thanks,

Brent Sorrentino

Hello I’ve run into a similar problem. Often it has to deal with making sure your spritesheets are set up correctly. If your sprite is too complex/ out of the frame height or width/ has too many frames/or is just generally has too many pixels, then it will work on the emulator but not on your device. You can only see this problem if you debug it on adb (if you have android)

Hello I’ve run into a similar problem. Often it has to deal with making sure your spritesheets are set up correctly. If your sprite is too complex/ out of the frame height or width/ has too many frames/or is just generally has too many pixels, then it will work on the emulator but not on your device. You can only see this problem if you debug it on adb (if you have android)