Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Problem using Swarm for android

Options
  • 21-11-2012 4:20pm
    #1
    Registered Users Posts: 1,859 ✭✭✭


    Hi,
    I have a game out that worked perfectly,no bugs. I decided to implement Swarm for leaderboards and it works just dandy for me.But for a lot of others(possibly running ICS and up) it freezes on boot of the app. I did wrap the call to Swarm.init in a runnable to see if that made a difference. The error from google play is
    ANR keyDispatchingTimedOut in SwarmMainActivity

    Anyone any experience of similar?


Comments

  • Registered Users Posts: 18,272 ✭✭✭✭Atomic Pineapple


    Hi,
    I have a game out that worked perfectly,no bugs. I decided to implement Swarm for leaderboards and it works just dandy for me.But for a lot of others(possibly running ICS and up) it freezes on boot of the app. I did wrap the call to Swarm.init in a runnable to see if that made a difference. The error from google play is
    ANR keyDispatchingTimedOut in SwarmMainActivity

    Anyone any experience of similar?

    Whats the full error trace? An ANR means your blocking the Main thread for more than 5 seconds, I haven't used Swarm so what exactly are you doing around the error? Have you tried using an AsyncTask if it is a long running network operation?


  • Registered Users Posts: 1,859 ✭✭✭superflyninja


    Well it points roughly to the oncreate method of my activity( i only have one). The gist of it is that Swarm initialises,so it logs the user in or shows the register screen if there is no saved info. Then the game launches. Im not all that familiar(ie not familiar at all) with running an asynch thread. It would just be the one statement Id need to run in that manner id say.... The full trace is
    DALVIK THREADS:
    "main" prio=5 tid=1 WAIT
    | group="main" sCount=1 dsCount=0 s=N obj=0x40028970 self=0xcd38
    | sysTid=831 nice=0 sched=0/0 cgrp=unknown handle=-1345026008
    at java.lang.Object.wait(Native Method)
    - waiting on <0x4484c208> (a java.lang.Object)
    at java.lang.Object.wait(Object.java:288)
    at phorgan.gameframework.impl.GLGame.onPause(GLGame.java:116)
    at com.phorgan.game.fartjumper.FartJumper.onPause(FartJumper.java:49)
    at android.app.Activity.performPause(Activity.java:3842)
    at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1190)
    at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3335)
    at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3305)
    at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3288)
    at android.app.ActivityThread.access$2500(ActivityThread.java:125)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2040)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:123)
    at android.app.ActivityThread.main(ActivityThread.java:4627)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:521)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    at dalvik.system.NativeStart.main(Native Method)

    "android.hardware.SensorManager$SensorThread" prio=5 tid=10 NATIVE
    | group="main" sCount=1 dsCount=0 s=N obj=0x44853348 self=0x12b158
    | sysTid=840 nice=-8 sched=0/0 cgrp=unknown handle=1336392
    at android.hardware.SensorManager.sensors_data_poll(Native Method)
    at android.hardware.SensorManager$SensorThread$SensorThreadRunnable.run(SensorManager.java:389)
    at java.lang.Thread.run(Thread.java:1096)

    "SoundPoolThread" prio=5 tid=8 NATIVE
    | group="main" sCount=1 dsCount=0 s=N obj=0x44851fb8 self=0x1451d0
    | sysTid=839 nice=0 sched=0/0 cgrp=unknown handle=1207096
    at dalvik.system.NativeStart.run(Native Method)

    "SoundPool" prio=5 tid=9 NATIVE
    | group="main" sCount=1 dsCount=0 s=N obj=0x44852120 self=0x149248
    | sysTid=838 nice=0 sched=0/0 cgrp=unknown handle=1206864
    at dalvik.system.NativeStart.run(Native Method)

    "GLThread 8" prio=5 tid=7 WAIT
    | group="main" sCount=1 dsCount=0 s=N obj=0x4484ed70 self=0x121b68
    | sysTid=837 nice=0 sched=0/0 cgrp=unknown handle=1165712
    at java.lang.Object.wait(Native Method)
    - waiting on <0x4012f900> (a android.opengl.GLSurfaceView$GLThreadManager)
    at java.lang.Object.wait(Object.java:288)
    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1290)
    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)

    "Binder Thread #2" prio=5 tid=6 NATIVE
    | group="main" sCount=1 dsCount=0 s=N obj=0x448366e0 self=0x133928
    | sysTid=836 nice=0 sched=0/0 cgrp=unknown handle=1198456
    at dalvik.system.NativeStart.run(Native Method)

    "Binder Thread #1" prio=5 tid=5 NATIVE
    | group="main" sCount=1 dsCount=0 s=N obj=0x44835920 self=0x13bd80
    | sysTid=835 nice=0 sched=0/0 cgrp=unknown handle=1203536
    at dalvik.system.NativeStart.run(Native Method)

    "Compiler" daemon prio=5 tid=4 VMWAIT
    | group="system" sCount=1 dsCount=0 s=N obj=0x448342a0 self=0x13b638
    | sysTid=834 nice=0 sched=0/0 cgrp=unknown handle=1301776
    at dalvik.system.NativeStart.run(Native Method)

    "Signal Catcher" daemon prio=5 tid=3 RUNNABLE
    | group="system" sCount=0 dsCount=0 s=N obj=0x448341e8 self=0x12c838
    | sysTid=833 nice=0 sched=0/0 cgrp=unknown handle=1270408
    at dalvik.system.NativeStart.run(Native Method)

    "HeapWorker" daemon prio=5 tid=2 VMWAIT
    | group="system" sCount=1 dsCount=0 s=N obj=0x434786d8 self=0x11fe20
    | sysTid=832 nice=0 sched=0/0 cgrp=unknown handle=1302032
    at dalvik.system.NativeStart.run(Native Method)


  • Registered Users Posts: 1 SwarmConnect


    Hey superflyninja!

    Matt here. I'm a developer from Swarm (aka SwarmConnect), and I realize it might be a bit late to answer the question. but better late than never, right? We recently launched a new version of the Swarm SDK which should help to resolve the issues you're seeing. If you don't want to upgrade to the latest version you can try moving the call to Swarm.init() to the end of onResume() instead of putting it up in onCreate(). Please send an email to support[at]swarmconnect(dot)com if there's anything else we can do to help :).


Advertisement