Android Question Kiosk Mode - Error: Unfortunately App has stopped

metzeller_2013

Member
Licensed User
Longtime User
Good day,
My Kiosk App runs smoothly when running it within android, but with kiosk mode run at start up, my app crashes giving this error: Unfortunately App has stopped, something like that....
Any one have any idea? Tnx....
 

DonManfred

Expert
Licensed User
Longtime User
Look in the log (maybe the unfiltered) to see the error
 
Upvote 0

metzeller_2013

Member
Licensed User
Longtime User
Here is another sir

LogCat connected to: B4A-Bridge: MyPhone MyPhone Agua Rio
--------- beginning of /dev/log/main
zygote get new systemTid : 2202
threadid=2: interp stack at 0x5a490000
threadid=3: interp stack at 0x5a5b0000
Elevating priority from 0 to -8
threadid=4: interp stack at 0x5a6d0000
zygote get thread init done
create interp thread : stack size=128KB
create new thread
new thread created
update thread list
threadid=5: interp stack at 0x5cc2a000
threadid=5: created from interp
start new thread
create interp thread : stack size=128KB
create new thread
new thread created
update thread list
threadid=5: notify debugger
threadid=5 (ReferenceQueueDaemon): calling run()
threadid=6: interp stack at 0x5cd6d000
threadid=6: created from interp
start new thread
threadid=6: notify debugger
threadid=6 (FinalizerDaemon): calling run()
create interp thread : stack size=128KB
create new thread
new thread created
update thread list
threadid=7: interp stack at 0x5ce8d000
threadid=7: created from interp
start new thread
error opening trace file: No such file or directory (2)
threadid=7: notify debugger
threadid=7 (FinalizerWatchdogDaemon): calling run()
threadid=8: interp stack at 0x5d2ab000
threadid=9: interp stack at 0x5d3cb000
AssetManager-->addDefaultAssets CIP path not exsit!
open_cached_dex_file : /data/app/anywheresoftware.b4a.b4abridge-2.apk /data/dalvik-cache/data@[email protected][email protected]
GC_FOR_ALLOC freed 186K (1483), 12% free 2976K/3372K, paused 11ms, total 11ms
Grow heap (frag case) to 6.623MB for 3686416-byte allocation
GC_CONCURRENT freed 1K (34), 6% free 6575K/6976K, paused 1ms+1ms, total 13ms
WAIT_FOR_CONCURRENT_GC blocked 12ms
>>> 0 0 android
>>> 0 1 mali
loaded /system/lib/egl/libEGL_mali.so
loaded /system/lib/egl/libGLESv1_CM_mali.so
loaded /system/lib/egl/libGLESv2_mali.so
load_library(linker.cpp:759): library "libmaliinstr.so" not found
appName=anywheresoftware.b4a.b4abridge, acAppName=com.android.cts.openglperf
0
appName=anywheresoftware.b4a.b4abridge, acAppName=com.android.browser
0
create handle(0x5cbc51e8) (w:720, h:1280, f:1)
close handle(0x5cbc51e8) (w:720 h:1280 f:1)
create handle(0x5cbc51e8) (w:720, h:1280, f:1)
Enabling debug mode 0
path=/storage/sdcard1
getDefaultPath path=/storage/sdcard1
defaultPath = /storage/sdcard1##########
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Enter init, sThreadRefCount:0
mWifiServiceMessenger == null
--------- beginning of /dev/log/system
hoder:android.app.IActivityManager$ContentProviderHolder@4160ac30,provider,holder.Provider:android.content.ContentProviderProxy@4160b350
from db cache, name = install_non_market_apps , value = 1
onWindowFocus: null softInputMode=290 first=true flags=#1810100
START INPUT: com.android.internal.policy.impl.PhoneWindow$DecorView{41194390 V.E..... R.....ID 0,0-720,1280} ic=null tba=android.view.inputmethod.EditorInfo@4160cc80 controlFlags=#104
Starting input: Bind result=InputBindResult{null com.android.inputmethod.latin/.LatinIME #2}
create handle(0x5ea0d7c0) (w:720, h:1280, f:1)
create handle(0x5ea129a0) (w:720, h:1280, f:1)
create handle(0x5ea12f18) (w:720, h:1280, f:1)
No package identifier when getting name for resource number 0x00000002
Touch down dispatch to android.widget.Button{415915f0 VFED..C. ........ 21,206-445,312 #2}, event = MotionEvent { action=ACTION_DOWN, id[0]=0, x[0]=303.54926, y[0]=61.67682, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=86866, downTime=86866, deviceId=2, source=0x1002 }
No package identifier when getting name for resource number 0x00000002
Touch up dispatch to android.widget.Button{415915f0 VFED..C. ...p.... 21,206-445,312 #2}, event = MotionEvent { action=ACTION_UP, id[0]=0, x[0]=303.54926, y[0]=61.67682, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=86913, downTime=86866, deviceId=2, source=0x1002 }
[STC::queueBuffer] (this:0x5cbdf1f8) fps:5.65, dur:3007.58, max:2673.97, min:14.21
invalidate [system]: current 5 != cached 0
from db cache, name = sound_effects_enabled , value = 0
** Service (service1) Create **
create interp thread : stack size=128KB
create new thread
new thread created
update thread list
threadid=10: interp stack at 0x5fa78000
threadid=10: created from interp
start new thread
threadid=10: notify debugger
threadid=10 (Thread-197): calling run()
** Service (service1) Start **
create interp thread : stack size=128KB
create new thread
new thread created
update thread list
threadid=11: interp stack at 0x5fb98000
threadid=11: created from interp
start new thread
threadid=11: notify debugger
threadid=11 (pool-2-thread-1): calling run()
Connected to B4A-Bridge (Wifi)
path=/storage/sdcard1
getDefaultPath path=/storage/sdcard1
defaultPath = /storage/sdcard1##########
create interp thread : stack size=128KB
create new thread
new thread created
update thread list
threadid=12: interp stack at 0x5fcb8000
threadid=12: created from interp
start new thread
create interp thread : stack size=128KB
create new thread
new thread created
update thread list
threadid=12: notify debugger
threadid=12 (Thread-199): calling run()
threadid=13: interp stack at 0x5fdd8000
threadid=13: created from interp
start new thread
threadid=13: notify debugger
threadid=13 (Thread-200): calling run()
[STC::queueBuffer] (this:0x5cbdf1f8) fps:0.22, dur:13345.52, max:13266.63, min:15.22
[STC::queueBuffer] this:0x5cbdf1f8, api:1, last queue time elapsed:13266.63
create interp thread : stack size=128KB
create new thread
new thread created
update thread list
threadid=14: interp stack at 0x5fef8000
threadid=14: created from interp
start new thread
threadid=14: notify debugger
threadid=14 (Thread-201): calling run()
create interp thread : stack size=128KB
create new thread
new thread created
update thread list
threadid=15: interp stack at 0x60018000
threadid=15: created from interp
start new thread
threadid=15: notify debugger
threadid=15 (java.lang.ProcessManager): calling run()
 
Upvote 0

metzeller_2013

Member
Licensed User
Longtime User
Sir @Erel this is what I've got from the log


LogCat connected to: 0123456789ABCDEF
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
** Service (kioskservice) Create **
** Service (kioskservice) Start **
java.lang.ClassCastException: java.lang.Object cannot be cast to java.lang.String
at anywheresoftware.b4a.keywords.Common.getComponentBA(Common.java:1001)
at anywheresoftware.b4a.keywords.Common.IsPaused(Common.java:988)
at metzOrg.kkmcmobilecollector.kioskservice._service_start(kioskservice.java:169)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:159)
at metzOrg.kkmcmobilecollector.kioskservice.handleStart(kioskservice.java:68)
at metzOrg.kkmcmobilecollector.kioskservice.onStartCommand(kioskservice.java:53)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2850)
at android.app.ActivityThread.access$1900(ActivityThread.java:165)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5391)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Unable to start service metzOrg.kkmcmobilecollector.kioskservice@41110498 with Intent { cmp=metzOrg.kkmcmobilecollector/.kioskservice (has extras) }: java.lang.RuntimeException: java.lang.ClassCastException: java.lang.Object cannot be cast to java.lang.String
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2867)
at android.app.ActivityThread.access$1900(ActivityThread.java:165)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5391)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.ClassCastException: java.lang.Object cannot be cast to java.lang.String
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:201)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:159)
at metzOrg.kkmcmobilecollector.kioskservice.handleStart(kioskservice.java:68)
at metzOrg.kkmcmobilecollector.kioskservice.onStartCommand(kioskservice.java:53)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2850)
... 10 more
Caused by: java.lang.ClassCastException: java.lang.Object cannot be cast to java.lang.String
at anywheresoftware.b4a.keywords.Common.getComponentBA(Common.java:1001)
at anywheresoftware.b4a.keywords.Common.IsPaused(Common.java:988)
at metzOrg.kkmcmobilecollector.kioskservice._service_start(kioskservice.java:169)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
... 14 more
 
Upvote 0

metzeller_2013

Member
Licensed User
Longtime User
here sir

B4X:
Sub Service_Start (StartingIntent As Intent)
    Service.StartForeground(1, Notification)
    If IsPaused(ActivityName) Then Timer1.Enabled = True
End Sub

i have this on my Main Activity
B4X:
Sub Activity_Pause (UserClosed As Boolean)
KioskService.ActivityName= Me
If kiosk Then StartServiceAt(KioskService, DateTime.Now + 1 * DateTime.TicksPerSecond, False)   
End Sub
 
Upvote 0

metzeller_2013

Member
Licensed User
Longtime User
at service module

B4X:
'Service module
Sub Process_Globals
    Dim Notification As Notification
    Dim Timer1 As Timer
    Private pe As PhoneEvents
    Private screenOff As Boolean = False
    Dim ActivityName As Object
End Sub
 
Upvote 0

metzeller_2013

Member
Licensed User
Longtime User
got an idea....
Main is the main activity
:rolleyes:?????

B4X:
Sub Service_Start (StartingIntent As Intent)
  Service.StartForeground(1, Notification)
  Try
    If IsPaused(ActivityName) Then Timer1.Enabled = True
  catch
    If IsPaused(Main) Then Timer1.Enabled = True
End try
End Sub
 
Upvote 0
Top