1

i am trying to build android game from this libgdx based games but the android app crashes when ported to android game the libgdx code i downloaded from http://rengelbert.com/blog/downloads/froggerLibGDXSource.zip

and i have build the android code for this game you can download it from here https://rapidshare.com/files/3456268683/FroggerLibGDXAndroid.zip

the game crashes and not starting Please help me in porting the game to android

this is the error message i got

/AndroidRuntime( 2966): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
/AndroidRuntime( 2966): CheckJNI is ON
/AndroidRuntime( 2966): --- registering native functions ---
/ActivityManager(   65): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER
/AndroidRuntime( 2966): Shutting down VM
/dalvikvm( 2966): Debugger has detached; object registry had 1 entries
/AndroidRuntime( 2966): NOTE: attach of thread 'Binder Thread #3' failed
/ActivityManager(   65): Start proc com.libgdx.screen for activity com.libgdx.screen/.LibgdxScreenAndroidActivity: pid=29
/dalvikvm( 2973): Trying to load lib /data/data/com.libgdx.screen/lib/libgdx.so 0x43e37a00
/dalvikvm( 2973): Added shared lib /data/data/com.libgdx.screen/lib/libgdx.so 0x43e37a00
/dalvikvm( 2973): No JNI_OnLoad found in /data/data/com.libgdx.screen/lib/libgdx.so 0x43e37a00, skipping init
/dalvikvm(  303): GC_EXPLICIT freed 1722 objects / 57656 bytes in 13322ms
/qemud   (   38): fdhandler_accept_event: accepting on fd 10
/qemud   (   38): created client 0x1073a8 listening on fd 15
/qemud   (   38): client_fd_receive: attempting registration for service 'sensors'
/qemud   (   38): client_fd_receive:    -> received channel id 17
/qemud   (   38): client_registration: registration succeeded for client 17
/qemud   (   38): fdhandler_event: disconnect on fd 15
/AndroidInput( 2973): sensor listener setup
/libEGL  ( 2973): egl.cfg not found, using default config
/QemuSensors(   65): data__poll: len=-1, errno=9: Bad file number
/QemuSensors(   65): data__poll: len=-1, errno=9: Bad file number
/libEGL  ( 2973): loaded /system/lib/egl/libGLES_android.so
/QemuSensors(   65): data__poll: len=-1, errno=9: Bad file number
/QemuSensors(   65): data__poll: len=-1, errno=9: Bad file number
/QemuSensors( 2973): data__poll: len=-1, errno=9: Bad file number
/ActivityManager(   65): Launch timeout has expired, giving up wake lock!
/QemuSensors(   65): data__poll: len=-1, errno=9: Bad file number
/QemuSensors(   65): data__poll: len=-1, errno=9: Bad file number
/AndroidGraphics( 2973): OGL renderer: Android PixelFlinger 1.3
/ActivityManager(   65): Displayed activity com.libgdx.screen/.LibgdxScreenAndroidActivity: 10258 ms (total 10258 ms)
/AndroidGraphics( 2973): OGL vendor: Android
/AndroidGraphics( 2973): OGL version: OpenGL ES-CM 1.0
/AndroidGraphics( 2973): OGL extensions: GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_read_f
/AndroidGraphics( 2973): framebuffer: (5, 6, 5, 0)
/AndroidGraphics( 2973): depthbuffer: (16)
/AndroidGraphics( 2973): stencilbuffer: (0)
/AndroidGraphics( 2973): samples: (0)
/AndroidGraphics( 2973): coverage sampling: (false)
/QemuSensors(   65): data__poll: len=-1, errno=9: Bad file number
/QemuSensors(   65): data__poll: len=-1, errno=9: Bad file number
/ActivityManager(   65): Activity idle timeout for HistoryRecord{43f692f8 com.libgdx.screen/.LibgdxScreenAndroidActivity}
/dalvikvm( 2973): GC_EXTERNAL_ALLOC freed 1740 objects / 111376 bytes in 1622ms
/QemuSensors( 2973): data__poll: len=-1, errno=9: Bad file number
/AndroidGraphics( 2973): Managed meshes/app: { }
/AndroidGraphics( 2973): Managed textures/app: { }
/AndroidGraphics( 2973): Managed shaders/app: { }
/AndroidGraphics( 2973): Managed buffers/app: { }
/QemuSensors(   65): data__poll: len=-1, errno=9: Bad file number
/QemuSensors(   65): data__poll: len=-1, errno=9: Bad file number
lakshman
  • 95
  • 1
  • 3
  • 9
  • Please include some details about the crash. There is probably an exception in the log when running under Android. – P.T. Jul 05 '12 at 16:39
  • can u please check this game is not working in android. i am attaching both android and desktop versions. PLease check why this code is not working rapidshare.com/files/1274277113/libgdxgame.zip – lakshman Jul 06 '12 at 11:34
  • 1
    What type of device are you running on? It appears to be using the software gl renderer (PixelFlinger) so it probably won't run very well. Is there an actual error in there? That looks like mostly info messages. – nEx.Software Jul 06 '12 at 13:14

2 Answers2

3

Please try this and see if it solves the crash:

Go to the properties for the Android Project, make sure that the Jars and the Desktop Project are being exported. Check that Java Build Path -> Order and Export looks like this:

enter image description here

If you want to use a different Android version than 4.1 that's fine (I just don't have other versions installed so I changed it to 4.1).

nEx.Software
  • 6,782
  • 1
  • 26
  • 34
  • can u please check this game is not working in android. i am attaching both android and desktop versions. PLease check why this code is not working https://rapidshare.com/files/1274277113/libgdxgame.zip – lakshman Jul 06 '12 at 11:34
  • 1
    By not working do you mean just showing a blank screen? That's because the Desktop starter creates a new instance of ScreenTest(), while the Android starter creates a new instance of ScreenGame(). If by not working in some other way, you'll have to explain in what way it doesn't work. It works fine on my phone when I switch the Android starter to ScreenTest() – nEx.Software Jul 06 '12 at 13:01
  • thank you very much its fine working now it was showing blank screen in old sdk 1.6 emulator and in sdk 2.3 emulator its works fine – lakshman Jul 08 '12 at 17:25
  • In libgdx how show pause screen when user click on pause and it should be layer over the present screen and it should close the screen when user click on resume how can i implement it in libgdx. – lakshman Jul 13 '12 at 08:08
  • Let's move any further discussion (particularly about another topic) over to the badlogic forums so as to not clutter this space. – nEx.Software Jul 13 '12 at 13:57
0

I encountered the same problems and found a solution:

1) Open project settings of the project "FroggerLibGDXDesktop"

2) Go to "Java build path" / "Order and export"

3) Check all the jar files

4) Open project settings of the project "FroggerLibGDXAndroid"

5) Go to "Java build path" / "Order and export"

6) Check at least the "gdx-backend-android.jar" and the project "FroggerLibGDXDesktop"

Run the android app in emulator. Worked for me.

clash
  • 1