Android Question Can't add Starter Service to existing (old) app

Rusty

Well-Known Member
Licensed User
Longtime User
I was hoping the new V6.80 would resolve my inability to add a Starter service to my main app, but, alas, it doesn't help.
When I add the Starter service to the app and compile it, it compiles, but then blows up. Here is the log of that which mentions my app:
java.lang.RuntimeException: Unable to create service talkingsurvey.b4a.survey.starter: java.lang.RuntimeException: java.io.EOFException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3175)
at android.app.ActivityThread.access$1900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1515)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5912)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Caused by: java.lang.RuntimeException: java.io.EOFException
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:165)
at talkingsurvey.b4a.survey.starter.onCreate(starter.java:47)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3165)
... 9 more
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:77)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:335)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
... 11 more
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
[com.sec.android.policydm.aasa.AASAUpdater(55/<init>)]
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1948 android.content.ContextWrapper.bindService:546 com.sec.android.policydm.aasa.AASAUpdater.<init>:59 com.sec.android.policydm.aasa.AASAAgent.getAASAUpdater:21 com.sec.android.policydm.aasa.AASAAgent.Init:27
bindService callerProcessName:com.policydm, calleePkgName: com.samsung.aasaservice, action: com.samsung.aasaservice
checkUser: useridlist=null, currentuser=0
checkUser: useridlist=null, currentuser=0
checkUser: useridlist=null, currentuser=0
checkUser: useridlist=null, currentuser=0
no v2
Function: selinux_compare_spd_ram , priority [2] , priority version is VE=SEPF_SM-G360V_5.1.1_0047
[com.sec.android.policydm.aasa.AASAAgent(30/Init)] AASAUpdater Init Success
[DEBUG] get_category: variable seinfo: platform sensitivity: NULL, cateogry: NULL
getTopLevelResources: null for user 0
Start proc 14234:com.samsung.aasaservice/1000 for service com.samsung.aasaservice/.AASAService
in addTimaSignatureService
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
TimaSignature is unavailable
Added TimaKesytore provider
ActivityThread() - SAMP_ENABLE : true
Explicit concurrent mark sweep GC freed 43293(2MB) AllocSpace objects, 3(57KB) LOS objects, 32% free, 33MB/49MB, paused 2.683ms total 157.418ms
[com.policydm.db.XDB(1493/xdbDMffs_Init)] xdbDMffs_Init
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
onCreate()
getConfirmRuleVersion() : Version File is not exist.
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
[com.policydm.XDMApplication(611/xdmWakeLockAcquire)]
[com.policydm.XDMApplication(616/xdmWakeLockAcquire)] m_WakeLock is acquire!!
getTopLevelResources: null for user 0
[com.policydm.adapter.XDMTargetAdapter(164/xdmInitExternalStorageState)]
[com.policydm.ui.XUIAdapter(33/xuiAdpGetUiMode)] nDmUiMode : 0
[com.policydm.agent.XDMTask(192/xdmAgentTaskHandler)] XEVENT_OS_INITIALIZED
[com.policydm.adapter.XDMTargetAdapter(380/xdmGetExternalSDCardPath)] External SD Card Path : /storage/extSdCard
[com.policydm.agent.XDMAgent(143/xdmAgentSetSyncMode)] nSync = 0
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
[com.policydm.ui.XUIAdapter(33/xuiAdpGetUiMode)] nDmUiMode : 0
[com.policydm.agent.XDMTask(200/xdmAgentTaskHandler)] XEVENT_DM_INIT
FATAL EXCEPTION: main
Process: talkingsurvey.b4a.survey, PID: 14023
java.lang.RuntimeException: Unable to create service talkingsurvey.b4a.survey.starter: java.lang.RuntimeException: java.io.EOFException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3175)
at android.app.ActivityThread.access$1900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1515)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5912)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Caused by: java.lang.RuntimeException: java.io.EOFException
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:165)
at talkingsurvey.b4a.survey.starter.onCreate(starter.java:47)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3165)
... 9 more
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:77)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:335)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
... 11 more
[com.policydm.adapter.XDMTargetAdapter(226/xdmInitExternalStorageState)] bExternalStorageAvailable [true]
[com.policydm.adapter.XDMTargetAdapter(227/xdmInitExternalStorageState)] bExternalSDStorageAvailable [false]
isApplicationStateBlocked userId 0 pkgname talkingsurvey.b4a.survey
isApplicationStateBlocked userId 0 pkgname com.sec.android.app.launcher
Focused application set to: xxxx
Focus left window: 14023
getTopLevelResources: null for user 0
Force finishing activity 1 talkingsurvey.b4a.survey/.main
[com.policydm.XDMApplication(637/xdmWakeLockRelease)]
[com.policydm.XDMApplication(642/xdmWakeLockRelease)] m_WakeLock is release!!
[com.sec.android.fota.common.Network(88/isWiFiNetworkConnected)] WiFi Network is connected
getTopLevelResources: null for user 0
getTopLevelResources: null for user 0
[com.policydm.XDMApplication(220/onCreate)] DMApplication Start !
[com.policydm.XDMApplication(676/xdmGetNotibarState)] get NotibarState : 7
[com.policydm.ui.XUINotificationManager(47/xuiSetIndicator)] Indicator id : 7
[com.policydm.XDMApplication(668/xdmSetNotibarState)] set NotibarState : 7
*FMB* installDecor mIsFloating : true
*FMB* installDecor flags : 8519682
ro.product_ship = true
ro.debug_level = 0x4f4c
getTopLevelResources: null for user 0
[com.policydm.db.XDBAESCrypt(236/xdbGetCryptionkey)] try read dbString
TooboxThread #1 calls detatch()
Focus entered window: 952
[com.policydm.XSPPReceiver(52/onReceive)] ACTION_PACKAGE_ADDED. mPkgName:talkingsurvey.b4a.survey
[com.sec.android.policydm.aasa.AASAUpdater$1(72/onServiceConnected)] AASA: onServiceConnected
Error writing /proc/13087/oom_score_adj; errno=22
manageDisableList userId=0 what=0x0 pkg=Window{387fd70c u0 Application Error: talkingsurvey.b4a.survey}
Killing 13680:com.sec.android.widgetapp.dualclockdigital/u0a73 (adj 13): bgCount ##26
Killing 13087:com.sec.android.widgetapp.ap.hero.accuweather/u0a64 (adj 15): bgCount ##27
[background] Process cur broadcast BroadcastRecord{22d7bb26 u0 android.intent.action.PACKAGE_ADDED} DELIVERED for app ProcessRecord{2053864a 2200:com.android.contacts/u0a12}
[com.policydm.db.XDBFumoAdp(442/xdbGetFUMOStatus)] xdbGetFUMOStatus : 0
[background] Process cur broadcast BroadcastRecord{22d7bb26 u0 android.intent.action.PACKAGE_ADDED} DELIVERED for app ProcessRecord{11d6aa0b 13949:com.sec.android.gallery3d/u0a39}
startService callerProcessName:com.sec.android.gallery3d, calleePkgName: com.sec.android.gallery3d
*FMB* isFloatingMenuEnabled mFloatingMenuBtn : null
*FMB* isFloatingMenuEnabled return false
[com.policydm.db.XDBFumoAdp(574/xdbGetFUMOInitiatedType)] Initiated Type: 0
[com.policydm.polling.XPollingAgent(81/xpollingCheckVersionInfo)]
[com.policydm.agent.XDMUITask(219/xdmUIEvent)] XUI_DM_IDLE_STATE :true
[com.policydm.polling.XPollingAgent(280/xpollingCheckTimer)]
id=889 createSurf (73x73),1 flag=4, turvey
checkUser: useridlist=null, currentuser=0
checkUser: useridlist=null, currentuser=0
checkUser: useridlist=null, currentuser=0
checkUser: useridlist=null, currentuser=0
[com.sec.android.fota.common.Network(88/isWiFiNetworkConnected)] WiFi Network is connected
[com.policydm.polling.XPollingAgent(294/xpollingCheckTimer)] savedpollingtime : 2017/03/06/13:15:16
no v2
[com.policydm.polling.XPollingAgent(295/xpollingCheckTimer)] currentTime : 2017/03/02/08:38:42
Initialized EGL, version 1.4
[com.policydm.polling.XPollingAgent(299/xpollingCheckTimer)] Restart Timer..
[com.policydm.XDMApplication(683/xdmStartAlarm)] Alarm ID: 0
[com.policydm.db.XDBProfileListAdp(257/xdbGetNotiSavedInfo)] nSessionSaveState [0], nNotiUiEvent [0]
Function: selinux_compare_spd_ram , priority [2] , priority version is VE=SEPF_SM-G360V_5.1.1_0047
[com.policydm.noti.XNOTIAdapter(306/xnotiPushAdpExcuteResumeNoti)] nSessionSaveState:0
[DEBUG] get_category: variable seinfo: platform sensitivity: NULL, cateogry: NULL
[com.policydm.noti.XNOTIAdapter(307/xnotiPushAdpExcuteResumeNoti)] nNotiUiEvent:0
[com.policydm.noti.XNOTIAdapter(308/xnotiPushAdpExcuteResumeNoti)] nNotiRetryCount:0
[com.policydm.noti.XNOTIAdapter(348/xnotiPushAdpExcuteResumeNoti)] Current NOTI NOT SAVED State. EXIT.
[com.policydm.noti.XNOTIAdapter(175/xnotiPushAdpClearSessionStatus)]
[com.policydm.ui.XUIAdapter(40/xuiAdpSetUiMode)] nDmUiMode : 0
[com.policydm.db.XDBFumoAdp(453/xdbSetFUMOStatus)] xdbSetFUMOStatus : 0
getTopLevelResources: null for user 0
Start proc 14259:com.sec.android.app.myfiles/u0a41 for broadcast-2 com.sec.android.app.myfiles/.receiver.MyFilesReceiver
in addTimaSignatureService
System.exit called, status: 0
VM exiting with result code 0, cleanup skipped.
[com.policydm.db.XDBFumoAdp(552/xdbSetFUMOInitiatedType)] Initiated Type: 0
getTopLevelResources: null for user 0
[com.policydm.polling.XPollingAgent(321/xPollingReportReStartAlarm)]
channel '81fec9a Toast (server)' ~ Consumer closed input channel or an error occurred. events=0x9
channel '81fec9a Toast (server)' ~ Channel is unrecoverably broken and will be disposed!
channel '2a8dc592 talkingsurvey.b4a.survey/talkingsurvey.b4a.survey.main (server)' ~ Consumer closed input channel or an error occurred. events=0x9
channel '2a8dc592 talkingsurvey.b4a.survey/talkingsurvey.b4a.survey.main (server)' ~ Channel is unrecoverably broken and will be disposed!
TimaSignature is unavailable
Added TimaKesytore provider
Attempted to unregister already unregistered input channel '2a8dc592 talkingsurvey.b4a.survey/talkingsurvey.b4a.survey.main (server)'
id=883 Removed nain (3/9)
id=883 Removed nain (-2/9)
ActivityThread() - SAMP_ENABLE : true
WIN DEATH: Window{2a8dc592 u0 talkingsurvey.b4a.survey/talkingsurvey.b4a.survey.main}
Process talkingsurvey.b4a.survey (pid 14023)(adj 0) has died.(163,573)

I can't figure out why it won't let me add the service.
Does anyone else have this issue?
Does anyone have any suggestions?
I've tried starting a NEW project (with starter service) and adding my modules from my app; then compiling with the same results...
Any advice is appreciated.
Rusty
 

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello @Rusty,
It should be something from inside your Starter service because I just tried with a very old project (created with B4A v 4...) and I was able to add the Starter service, compile and run the app without troubles.
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Thanks lemonisdead,
I just deleted the original starter service; created a new project; copied the NEW starter Service (which is completely empty of code) to the OLD app; recompiled and

also the filtered logs say:
LogCat connected to: 10f75786
--------- beginning of system--------- beginning of main
java.lang.RuntimeException: Unable to create service talkingsurvey.b4a.survey.starter: java.lang.RuntimeException: java.net.SocketException: Socket closed
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3175)
at android.app.ActivityThread.access$1900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1515)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5912)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Caused by: java.lang.RuntimeException: java.net.SocketException: Socket closed
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:165)
at talkingsurvey.b4a.survey.starter.onCreate(starter.java:47)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3165)
... 9 more
Caused by: java.net.SocketException: Socket closed
at libcore.io.Posix.recvfromBytes(Native Method)
at libcore.io.Posix.recvfrom(Posix.java:185)
at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:250)
at libcore.io.IoBridge.recvfrom(IoBridge.java:553)
at java.net.PlainSocketImpl.read(PlainSocketImpl.java:485)
at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37)
at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
at java.io.InputStream.read(InputStream.java:162)
at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:149)
at java.io.BufferedInputStream.read(BufferedInputStream.java:234)
at java.io.DataInputStream.readByte(DataInputStream.java:75)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:335)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
... 11 more
java.lang.RuntimeException: Unable to create service talkingsurvey.b4a.survey.starter: java.lang.RuntimeException: java.io.EOFException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3175)
at android.app.ActivityThread.access$1900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1515)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5912)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Caused by: java.lang.RuntimeException: java.io.EOFException
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:165)
at talkingsurvey.b4a.survey.starter.onCreate(starter.java:47)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3165)
... 9 more
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:77)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:335)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
... 11 more

I appreciate your help, but still no happiness.
Regards,
Rusty
 
Upvote 0

udg

Expert
Licensed User
Longtime User
I've tried starting a NEW project (with starter service) and adding my modules from my app; then compiling with the same results...
That leads me to believe that something goes wrong in your existing modules or their interaction with an newly added service named "Starter".
Could it be that you already have an object with that name elsewhere in your code?
Anyway, try again the new project approach and add one by one your modules until you find the problematic one

Edit:
in post #1 you have
java.lang.RuntimeException: Unable to create service talkingsurvey.b4a.survey.starter: java.lang.RuntimeException: java.io.EOFException
while in post #3 you have
java.lang.RuntimeException: Unable to create service talkingsurvey.b4a.survey.starter: java.lang.RuntimeException: java.net.SocketException: Socket closed

something changed with the new approach. I am not good at reading those logs but it doesn't sound to me as a problem in your code.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
but then blows up
Did you tried to uninstall the "app without starter service" before you install the new "app with starter-service"?
Uninstall first and then compile and install the new version.

It is worth a try
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
Did you tried to uninstall the "app without starter service" before you install the new "app with starter-service"?
Uninstall first and then compile and install the new version.

It is worth a try

In addition to what is suggested by Don, before compiling've do you tried deleting ?

upload_2017-3-5_15-52-6.png
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Sorry for the late reply, I've been travelling...
I tried the CLEAN and add a service with another name; renamed to starter, etc.
In DEBUG, it still doesn't work.
In RELEASE mode it does compile. (Thanks for the suggestion Erel :))
It's good to work with brilliant people :)
I'd like it to work in DEBUG, if that is possible, otherwise development will be unreliable...
Thanks!
Rusty
 
Upvote 0

enginetrics

Member
Licensed User
Longtime User
Shooting in the dark here, but.....it appears that your app is trying to read or write to external SD but its not available.
storage. [com.policydm.adapter.XDMTargetAdapter(227/xdmInitExternalStorageState)] bExternalSDStorageAvailable [false]
Is this where the socket error is occurring?
 
Upvote 0

enginetrics

Member
Licensed User
Longtime User
Maybe the app is not letting go of the SD card resource handle before it is reloaded in the IDE under debug mode causing the resource to be unavailable at that time. Like I said previously, I'm shooting in the dark. I had a similar problem with httputils2 trying to run a job too soon before the previous job was done.
 
Upvote 0
Top