Android Question Add Starter Service to old applicaton

Rusty

Well-Known Member
Licensed User
I have an app that was developed during the ICS OS era. It has been upgraded as B4A has released new releases.
When the Start service was added to B4A, we tried adding a Starter and it failed. Since we didn't already have one, we continued without.
Now, I'd like to add a Starter service to the OLD application which is currently compiled and distributed using B4A 6.00.
When I merely add a Starter service to the OLD app and try to compile it, it fails with:
java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:545)
at libcore.io.IoBridge.recvfrom(IoBridge.java:509)
at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
at java.io.InputStream.read(InputStream.java:162)
at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142)
at java.io.BufferedInputStream.read(BufferedInputStream.java:227)
at anywheresoftware.b4a.shell.ShellConnector.readControlData(ShellConnector.java:190)
at anywheresoftware.b4a.shell.ShellConnector.connect(ShellConnector.java:185)
at anywheresoftware.b4a.shell.ShellConnector.run(ShellConnector.java:119)
at java.lang.Thread.run(Thread.java:841)
Caused by: libcore.io.ErrnoException: recvfrom failed: ECONNRESET (Connection reset by peer)
at libcore.io.Posix.recvfromBytes(Native Method)
at libcore.io.Posix.recvfrom(Posix.java:141)
at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:164)
at libcore.io.IoBridge.recvfrom(IoBridge.java:506)
... 10 more
Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x437c0160)
java.lang.RuntimeException: Unable to create service talkingsurvey.b4a.survey.starter: java.lang.RuntimeException: java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2749)
at android.app.ActivityThread.access$1800(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1375)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:165)
at talkingsurvey.b4a.survey.starter.onCreate(starter.java:46)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2739)
... 10 more
Caused by: java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:545)
at libcore.io.IoBridge.recvfrom(IoBridge.java:509)
at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
at java.io.InputStream.read(InputStream.java:162)
at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142)
at java.io.BufferedInputStream.read(BufferedInputStream.java:227)
at java.io.DataInputStream.readByte(DataInputStream.java:75)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:333)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
... 12 more
Caused by: libcore.io.ErrnoException: recvfrom failed: ECONNRESET (Connection reset by peer)
at libcore.io.Posix.recvfromBytes(Native Method)
at libcore.io.Posix.recvfrom(Posix.java:141)
at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:164)
at libcore.io.IoBridge.recvfrom(IoBridge.java:506)
... 24 more
System.exit() call: started ignoring fatal signals
java.lang.RuntimeException: Unable to create service talkingsurvey.b4a.survey.starter: java.lang.RuntimeException: java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2749)
at android.app.ActivityThread.access$1800(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1375)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:165)
at talkingsurvey.b4a.survey.starter.onCreate(starter.java:46)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2739)
... 10 more
Caused by: java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:545)
at libcore.io.IoBridge.recvfrom(IoBridge.java:509)
at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
at java.io.InputStream.read(InputStream.java:162)
at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142)
at java.io.BufferedInputStream.read(BufferedInputStream.java:227)
at java.io.DataInputStream.readByte(DataInputStream.java:75)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:333)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
... 12 more
Caused by: libcore.io.ErrnoException: recvfrom failed: ECONNRESET (Connection reset by peer)
at libcore.io.Posix.recvfromBytes(Native Method)
at libcore.io.Posix.recvfrom(Posix.java:141)
at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:164)
at libcore.io.IoBridge.recvfrom(IoBridge.java:506)
... 24 more
GC_CONCURRENT freed 279K, 6% free 5099K/5420K, paused 1ms+1ms, total 4ms
Compiler shutdown in progress - discarding request
Compiler shutdown in progress - discarding request
Compiler shutdown in progress - discarding request
Compiler shutdown in progress - discarding request
Compiler shutdown in progress - discarding request
Compiler shutdown in progress - discarding request
Compiler shutdown in progress - discarding request
Compiler shutdown in progress - discarding request
Compiler shutdown in progress - discarding request
Compiler shutdown in progress - discarding request
Compiler shutdown in progress - discarding request
Compiler shutdown in progress - discarding request
Compiler shutdown in progress - discarding request
Compiler shutdown in progress - discarding request
VM exiting with result code 0, cleanup skipped.
Process talkingsurvey.b4a.survey (pid 31693) has died.
--- calledFromForegroundUserOrSystemProcess ? calling uid = 1000 system uid = 1000 calling userId = 0, foreground user id = 0, calling pid = 536dalvik.system.NativeStart.run(Native Method)
channel '221e61d0 Toast (server)' ~ Consumer closed input channel or an error occurred. events=0x9
channel '221e61d0 Toast (server)' ~ Channel is unrecoverably broken and will be disposed!
Attempted to unregister already unregistered input channel '221e61d0 Toast (server)'
WIN DEATH: Window{220a30a8 u0 id=0 talkingsurvey.b4a.survey/talkingsurvey.b4a.survey.main}
WIN DEATH: Window{221e61d0 u0 id=0 Toast}
Force removing ActivityRecord{21eab168 u0 talkingsurvey.b4a.survey/.main id=0 t23}: app died, no saved state
SMS received security event: App[STOP/talkingsurvey.b4a.survey]
adjustConfigurationLw, config:{1.0 ?mcc?mnc ?locale ?layoutDir sw800dp w1280dp h727dp 160dpi xlrg land ?uimode ?night finger qwerty/v/v -nav/v} mLidState:1 mHasDockFeature:true mHasKeyboardFeature:true mHasHallSensorFeature:true config.hardKeyboardHidden:1
Total arena pages for JIT: 12
Total arena pages for JIT: 13
Total arena pages for JIT: 14
Total arena pages for JIT: 15
[TopPkgCurBat] NowPkgName[com.asus.launcher] Battery[53] TimeTick[1467909320747] OldPkgName[talkingsurvey.b4a.survey]
bindAppsUpdated start
bindAppsUpdated finished
I'm completely lost as to what is causing this. I've created a very small test program (NEW) and starter works fine...
Any suggestions?
 

fixit30

Active Member
Licensed User
Maybe try adding the Starter service that was created by the working test app?
 

Rusty

Well-Known Member
Licensed User
Thanks Fixit,
I tried that. I even created the test app; ported all modules, services and classes into the test app; copied and pasted MAIN into the test app and tried to run the TEST app. ...the same results. argh!
Rusty
 

Rusty

Well-Known Member
Licensed User
In Debug:
java.lang.RuntimeException: Unable to create service talkingsurvey.b4a.survey.starter: java.lang.RuntimeException: java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2749)
at android.app.ActivityThread.access$1800(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1375)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:165)
at talkingsurvey.b4a.survey.starter.onCreate(starter.java:46)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2739)
... 10 more
Caused by: java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:545)
at libcore.io.IoBridge.recvfrom(IoBridge.java:509)
at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
at java.io.InputStream.read(InputStream.java:162)
at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142)
at java.io.BufferedInputStream.read(BufferedInputStream.java:227)
at java.io.DataInputStream.readByte(DataInputStream.java:75)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:333)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invokeNative(Native Method)
In Release mode ... it works!
Is there a reason it doesn't work in Debug? How do you debug the Starter service?
Thanks Erel,
Rusty
 

Rusty

Well-Known Member
Licensed User
The best I can tell. With unfiltered logs, there are hundreds of lines of logging...
 
Top