1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question Error debugging "Unable to create service"

Discussion in 'Android Questions' started by Chianca, May 16, 2019.

  1. Chianca

    Chianca Member Licensed User

    Developers friends, I'm having problems debugging my project, I've seen several solutions here in the forum, but none helped me. Amongst them:

    * Make a Release and then try Debug again.
    * Make Ctrl + P
    * Debug in legacy mode
    * Close the project and reopen
    * Restart Widget and PC

    Note: The same code is running on another PC and works normally.

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    Please post the logs as text. Right click to copy.
    Peter Simpson likes this.
  3. Chianca

    Chianca Member Licensed User

    java.lang.RuntimeException: Unable to create service Chianca.CHAndroid.starter: java.lang.RuntimeException: java.io.EOFException
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3222)
    at android.app.ActivityThread.-wrap5(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1580)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6165)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
    Caused by: java.lang.RuntimeException: java.io.EOFException
    at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:164)
    at anywheresoftware.b4a.shell.Shell.start(Shell.java:102)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:92)
    at Chianca.CHAndroid.starter.onCreate(starter.java:34)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3212)
    ... 8 more
    Caused by: java.io.EOFException
    at java.io.DataInputStream.readFully(DataInputStream.java:200)
    at java.io.DataInputStream.readInt(DataInputStream.java:389)
    at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:136)
    ... 12 more
  4. techknight

    techknight Well-Known Member Licensed User

    And the above is an even different error than that of your picture.
  5. Chianca

    Chianca Member Licensed User

    They are the same error, only changes
    java.lang.RuntimeException: java.net.SocketException: Socket closed (conventional Debug)
    java.lang.RuntimeException: java.io.EOFException (USB debug mode)
  6. techknight

    techknight Well-Known Member Licensed User

    Those changes signify they are different errors! Even though they could be triggered by the same thing, they are still different.

    When I am in debug mode, I occasionally get that. and it usually happens if the computer is busy with those resources and the compiler cannot take the time away from the OS, so it eventually will time out.

    Long story short, the PC is busy doing other things when this happens. May need to increase the timeouts. Not sure if its fixed internally or not.
    Last edited: May 17, 2019
  7. Erel

    Erel Administrator Staff Member Licensed User

    This error can happen from two causes:
    1. The device app crashed while it started. This might happen if you have invalid code in Process_Globals.
    2. Network problem. Maybe the anti virus broke the connection.
  8. Chianca

    Chianca Member Licensed User

    I think this particular case is not a network problem, because I also do via USB and the same problem occurs. As for the invalid code, would it be in Main Activity?
  9. DonManfred

    DonManfred Expert Licensed User

    Starter and Mainactivity i think.
    Better check all Modules ProcessGlobals Code...
    Chianca likes this.
  10. Chianca

    Chianca Member Licensed User

    Wich invalid code should I search in all my activities Process Globals?

    Errors, initializes, etc?

    A think I have only variables declarations...
  11. Erel

    Erel Administrator Staff Member Licensed User

    Looks for warnings in the logs tab.
    Chianca likes this.
  12. Chianca

    Chianca Member Licensed User

    Great News!

    I think that the problem is solved.

    I've solved tons of warnigs, and debug now is runnig fine!

    Thank you so much!!
    Erel likes this.
  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