Games Common crash error with my Invaders game

Discussion in 'Game Development' started by andymc, Oct 17, 2017.

  1. andymc

    andymc Well-Known Member Licensed User

    I'm getting the following crash report for my Invaders game but can't figure out what's causing it:

    java.lang.RuntimeException:

    at android.os.Handler.<init> (Handler.java:200)

    at android.os.Handler.<init> (Handler.java:114)

    at android.app.Dialog.<init> (Dialog.java:152)

    at android.app.AlertDialog.<init> (AlertDialog.java:202)

    at android.app.AlertDialog$Builder.create (AlertDialog.java:1105)

    at anywheresoftware.b4a.BA.ShowErrorMsgbox (BA.java:260)

    at anywheresoftware.b4a.BA.raiseEvent2 (BA.java:224)

    at anywheresoftware.b4a.BA.raiseEvent2 (BA.java:170)

    at anywheresoftware.b4a.libgdx.LibGDX$b.render (SourceFile:136)

    at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame (SourceFile:439)

    at android.opengl.GLSurfaceView$GLThread.guardedRun (GLSurfaceView.java:1647)

    at android.opengl.GLSurfaceView$GLThread.run (GLSurfaceView.java:1352)


    Any one got any ideas?
     
  2. ilan

    ilan Expert Licensed User

    Maybe it has something to do with the msgbox u are showing when you click on back key.

    If u r using modal dialog it will hold the app and it may be the reason for that.

    I would recommend u to replace the msgbox with a own libgdx msg dialog. I mean showing a text with 2 options and maybe an lgtexture behind that may be the background.
     
    wonder likes this.
  3. andymc

    andymc Well-Known Member Licensed User

    yeah, I thought that but I don't know why it doesn't crash on my devices? You may be right though, that I should code a proper pause screen without using system dialogs.
     
  4. wonder

    wonder Expert Licensed User

    @ilan is right, once LibGDX kicks in, forget about system dialogs, you'll run into problems.
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    Is the Starter service included in your app? With Application_Error sub?
     
  6. andymc

    andymc Well-Known Member Licensed User

    @Erel Hi, no it's not starting any services, except google play services for leaderboards and achievements.
    If the player presses the back button during gameplay, then it pops up a standard system msgbox2 dialog. I've not been able to replicate the crash on my test devices using the back button here. the area I'm focusing on now is the google play services buttons on my main menu, they do crash for me sometimes.
     
  7. Erel

    Erel Administrator Staff Member Licensed User

  8. andymc

    andymc Well-Known Member Licensed User

    It's a different error but this is another one causing a lot of crash reports:
    Screenshot_20171018-101658.png
    I recently added google play services, do I need to add a check that it's managed to connect first or just wait a little longer before loading achievements?
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    I'm not familiar with this library. However you shouldn't see this dialog at all. Your app should instead crash and print the correct logs. This will happen once you add Application_Error.
     
  10. andymc

    andymc Well-Known Member Licensed User

    I will that erel, thanks. Is it just a case of adding a service called Starter and that's it?
     
  11. LucaMs

    LucaMs Expert Licensed User

    If you add a new service module naming it Starter you will not get its template, of course, and therefore not even the Application_Error routine.
    https://www.b4x.com/android/forum/threads/uncaught-exceptions.59805/#content
     
  12. DonManfred

    DonManfred Expert Licensed User

    create a new project. You´ll get/see the default code for the Starter service....
     
  13. An Schi

    An Schi Active Member Licensed User

    Do you maybe have a b4a version before starter service was introduced? (Not sure, maybe <6)
     
  14. LucaMs

    LucaMs Expert Licensed User

    I think he just removed the Starter service.
     
  15. Erel

    Erel Administrator Staff Member Licensed User

    The default starter template is added automatically when you add a service names Starter.
     
    ilan and DonManfred like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice