Android Question Help needed to interpret ANR report

RandomCoder

Well-Known Member
Licensed User
I've got one review stating that they are unable to start my App on a Note 4 and in my Developer Console I have this report of an ANR which occurred on a "Lenovo X2 Pro (S7)" running Android 4.0.3-4.0.4 and the title of the ANR report is "ANR keyDispatchingTimeOut in b4a.upnpBrowser/.main"

I have absolutely no idea what this means or where to start looking for the error, searching keydispatching yielded no results, can anyone shed some light on it for me?

The App can be found here... https://play.google.com/store/apps/details?id=b4a.upnpBrowser&hl=en_GB


----- pid 2865 at 2015-06-01 01:30:06 -----
Cmd line: b4a.upnpBrowser

DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0)
"main" prio=5 tid=1 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x40a3e460 self=0x158f0
| sysTid=2865 nice=0 sched=0/0 cgrp=[fopen-error:2] handle=1074087400
| schedstat=( 0 0 0 ) utm=3375 stm=696 core=0
at android.media.MediaPlayer._reset(Native Method)
at android.media.MediaPlayer.reset(MediaPlayer.java:1190)
at anywheresoftware.b4a.audio.MediaPlayerStreamWrapper.Load(MediaPlayerStreamWrapper.java:101)
at b4a.upnpBrowser.music_service._musicstream_load(music_service.java:177)
at b4a.upnpBrowser.music_service._service_start(music_service.java:292)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at b4a.upnpBrowser.music_service.handleStart(music_service.java:71)
at b4a.upnpBrowser.music_service.onStartCommand(music_service.java:55)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2482)
at android.app.ActivityThread.access$1900(ActivityThread.java:132)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1220)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4575)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)

"RefQueueWorker@org.apache.http.impl.conn.tsccm.ConnPoolByRoute@41426430" daemon prio=5 tid=13 WAIT
| group="main" sCount=1 dsCount=0 obj=0x41080d38 self=0x300320
| sysTid=2886 nice=0 sched=0/0 cgrp=[fopen-error:2] handle=2534872
| schedstat=( 0 0 0 ) utm=0 stm=0 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x41072368> (a java.lang.ref.ReferenceQueue)
at java.lang.Object.wait(Object.java:401)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
at org.apache.http.impl.conn.tsccm.RefQueueWorker.run(RefQueueWorker.java:102)
at java.lang.Thread.run(Thread.java:856)

"Binder Thread #4" prio=5 tid=12 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x413d0dd8 self=0x2fa7e0
| sysTid=2880 nice=0 sched=0/0 cgrp=[fopen-error:2] handle=2846656
| schedstat=( 0 0 0 ) utm=3 stm=5 core=0
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #3" prio=5 tid=11 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x41456490 self=0x2f6c08
| sysTid=2879 nice=0 sched=0/0 cgrp=[fopen-error:2] handle=2874056
| schedstat=( 0 0 0 ) utm=6 stm=2 core=0
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #2" prio=5 tid=10 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x4106d3a0 self=0x2cc968
| sysTid=2877 nice=0 sched=0/0 cgrp=[fopen-error:2] handle=2506224
| schedstat=( 0 0 0 ) utm=6 stm=2 core=0
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=9 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x4106d1d8 self=0x304d10
| sysTid=2876 nice=0 sched=0/0 cgrp=[fopen-error:2] handle=2458872
| schedstat=( 0 0 0 ) utm=5 stm=3 core=0
at dalvik.system.NativeStart.run(Native Method)

"FinalizerWatchdogDaemon" daemon prio=5 tid=8 WAIT
| group="main" sCount=1 dsCount=0 obj=0x410694b8 self=0x2f0698
| sysTid=2875 nice=0 sched=0/0 cgrp=[fopen-error:2] handle=2434632
| schedstat=( 0 0 0 ) utm=0 stm=0 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x40a4c9c8> (a java.lang.Daemons$FinalizerWatchdogDaemon)
at java.lang.Object.wait(Object.java:364)
at java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:213)
at java.lang.Thread.run(Thread.java:856)

"FinalizerDaemon" daemon prio=5 tid=7 WAIT
| group="main" sCount=1 dsCount=0 obj=0x41069360 self=0x2f8c38
| sysTid=2874 nice=0 sched=0/0 cgrp=[fopen-error:2] handle=2520528
| schedstat=( 0 0 0 ) utm=21 stm=2 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x40a345d0> (a java.lang.ref.ReferenceQueue)
at java.lang.Object.wait(Object.java:401)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:168)
at java.lang.Thread.run(Thread.java:856)
The whole ANR report can be found in the file attached, it was too large to post it all here.
 

Attachments

fixit30

Active Member
Licensed User
Screenshot_2015-06-04-20-02-12.png
I have a Note 4. Just tested your app and only saw my UPNP device once. Subsequent runs just showed a blank list view?

My Device has Lolipop.

Let me know if I can help you further.
 

RandomCoder

Well-Known Member
Licensed User
Thank you for the offer of assistance. Does pressing the refresh button in the title bar clear the screen and display a toast message stating "Refreshing device list..."?
 

fixit30

Active Member
Licensed User
Thank you for the offer of assistance. Does pressing the refresh button in the title bar clear the screen and display a toast message stating "Refreshing device list..."?
Yes it does, but comes back with a blank list again...
 

RandomCoder

Well-Known Member
Licensed User
This is very strange. I've just run a test by turning off all my media servers but leaving my WiFi on the Tablet turned on so that it can communicate with the router and other non UPNP devices connected to the network and it correctly produces the following message...
Network Error...

Server(s) not responding
Check wifi is turned on and rescan
So I'm guessing that your phone is detecting a device on your network but for some reason not retrieving any description or icon file for that device. Does clicking on the blank item do anything?
If I update the source code in the other forum (it's a project that I originally posted in the share your creations section along with the source) would you be willing to run it in debug mode to determine what is going on?
What UPNP device do you have on your network? Maybe I could install the same on my network thus enabling me to do my own debugging and not trouble you any more?

Thanks for the help this far!
 

fixit30

Active Member
Licensed User
I'm more than happy to help you investigate further.

OK. So I just fired up your app again and had the following displayed. I think I pressed the home button to exit the app. It seems to take a LONG time to populate the info.

Screenshot_2015-06-04-20-40-57.png


It is detecting a Thomson TG587n v2 router.

Clicking on the device does nothing...
 
Last edited:

RandomCoder

Well-Known Member
Licensed User
Well this is indeed strange as my App only searches for "urn:schemas-upnp-org:device:MediaServer:1" which are devices that contain and can stream Media. Do you have any media servers on your network e.g. TwonkyMedia, XBMC, OpenELEC, Windows Media Shares etc?
Would you be willing to run the App through B4A using the Rapid debugger and send me the log either here or via PM?
The source files can be found here UPNP Browser - Source Files Included
You'll need B4A Version 4 but if you don't have that I can try converting it to an older version?

The log provides a wealth of information, and if the Thompson router is broadcasting itself as a MediaServer then I may need to find a way to filter routers out of the list as I'm sure that if this one is doing it then there will be others also doing the same thing. As an example of what information if written to the log (only when running in debug mode), here is the first few lines of my log...
M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
MAN: "ssdp:discover"
MX: 2
ST: urn:schemas-upnp-org:device:MediaServer:1


HTTP/1.1 200 OK
ST:urn:schemas-upnp-org:device:MediaServer:1
USN:uuid:5d90561c-7aed-4b5e-b464-03d3a5440d79::urn:schemas-upnp-org:device:MediaServer:1
Location:http://192.168.0.18:2869/upnphost/udhisapi.dll?content=uuid:5d90561c-7aed-4b5e-b464-03d3a5440d79
OPT:"http://schemas.upnp.org/upnp/1/0/"; ns=01
01-NLS:f70682d158a78e337a024d39169957c7
Cache-Control:max-age=900
Server:Microsoft-Windows-NT/5.1 UPnP/1.0 UPnP-Device-Host/1.0
Ext:

uuid = uuid:5d90561c-7aed-4b5e-b464-03d3a5440d79::urn:schemas-upnp-org:device:MediaServer:1
location = http://192.168.0.18:2869/upnphost/udhisapi.dll?content=uuid:5d90561c-7aed-4b5e-b464-03d3a5440d79
rootUrl = http://192.168.0.18:2869
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

HTTP/1.1 200 OK
ST:urn:schemas-upnp-org:device:MediaServer:1
USN:uuid:9a64dd51-c1bf-4ebb-ac51-32b834930abb::urn:schemas-upnp-org:device:MediaServer:1
Location:http://192.168.0.12:2869/upnphost/udhisapi.dll?content=uuid:9a64dd51-c1bf-4ebb-ac51-32b834930abb
OPT:"http://schemas.upnp.org/upnp/1/0/"; ns=01
01-NLS:d67c7a586c47ff785a0f93a638d6f147
Cache-Control:max-age=900
Server:Microsoft-Windows-NT/5.1 UPnP/1.0 UPnP-Device-Host/1.0
Ext:

uuid = uuid:9a64dd51-c1bf-4ebb-ac51-32b834930abb::urn:schemas-upnp-org:device:MediaServer:1
location = http://192.168.0.12:2869/upnphost/udhisapi.dll?content=uuid:9a64dd51-c1bf-4ebb-ac51-32b834930abb
rootUrl = http://192.168.0.12:2869
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

HTTP/1.1 200 OK
ST:urn:schemas-upnp-org:device:MediaServer:1
USN:uuid:05df2080-336d-40d5-8581-b5c1d6e7523e::urn:schemas-upnp-org:device:MediaServer:1
Location:http://192.168.0.18:2869/upnphost/udhisapi.dll?content=uuid:05df2080-336d-40d5-8581-b5c1d6e7523e
OPT:"http://schemas.upnp.org/upnp/1/0/"; ns=01
01-NLS:f70682d158a78e337a024d39169957c7
Cache-Control:max-age=900
Server:Microsoft-Windows-NT/5.1 UPnP/1.0 UPnP-Device-Host/1.0
Ext:

uuid = uuid:05df2080-336d-40d5-8581-b5c1d6e7523e::urn:schemas-upnp-org:device:MediaServer:1
location = http://192.168.0.18:2869/upnphost/udhisapi.dll?content=uuid:05df2080-336d-40d5-8581-b5c1d6e7523e
rootUrl = http://192.168.0.18:2869
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##### All UPNP servers responded #####
HTTP for index... 0 = http://192.168.0.18:2869/upnphost/udhisapi.dll?content=uuid:5d90561c-7aed-4b5e-b464-03d3a5440d79
HTTP for index... 1 = http://192.168.0.12:2869/upnphost/udhisapi.dll?content=uuid:9a64dd51-c1bf-4ebb-ac51-32b834930abb
HTTP for index... 2 = http://192.168.0.18:2869/upnphost/udhisapi.dll?content=uuid:05df2080-336d-40d5-8581-b5c1d6e7523e
##### SERVER LIST DISPLAYED #####
JobName = Description uuid:5d90561c-7aed-4b5e-b464-03d3a5440d79::urn:schemas-upnp-org:device:MediaServer:1, Success = true
##### DEVICE DESCRIPTION XML FILE #####
<?xml version="1.0"?>

<root xmlns="urn:schemas-upnp-org:device-1-0">

<specVersion>

<major>1</major>

<minor>0</minor>

</specVersion>

<device>

<UDN>uuid:5d90561c-7aed-4b5e-b464-03d3a5440d79</UDN>

<friendlyName>LAPTOP-PC: ALAN:</friendlyName>

<deviceType>urn:schemas-upnp-org:device:MediaServer:1</deviceType>

<manufacturer>Microsoft Corporation</manufacturer>

<manufacturerURL>http://www.microsoft.com</manufacturerURL>

<modelName>Windows Media Player Sharing</modelName>

<modelNumber>12.0</modelNumber>

<modelURL>http://go.microsoft.com/fwlink/?LinkId=105926</modelURL>

<serialNumber>{FFF81D98-776D-4EA0-841D-890611F0B024}</serialNumber>

<dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMS-1.50</dlna:X_DLNADOC>

<iconList>

<icon>

<mimetype>image/jpeg</mimetype>

<width>120</width>

<height>120</height>

<depth>24</depth>

<url>/upnphost/udhisapi.dll?content=uuid:03db2bc8-dc3e-4ef3-8397-a9beca5d812e</url>

</icon>

<icon>

<mimetype>image/png</mimetype>

<width>120</width>



<height>120</height>

<depth>24</depth>

<url>/upnphost/udhisapi.dll?content=uuid:3269c531-8ac1-4d64-a62d-efb6bd2073fa</url>

</icon>

<icon>

<mimetype>image/jpeg</mimetype>

<width>48</width>

<height>48</height>

<depth>24</depth>

<url>/upnphost/udhisapi.dll?content=uuid:0f388fea-38b5-4e4e-ade0-5d5d0eb1bd09</url>

</icon>

<icon>

<mimetype>image/png</mimetype>

<width>48</width>

<height>48</height>

<depth>24</depth>

<url>/upnphost/udhisapi.dll?content=uuid:2694f85c-8939-42c0-92f9-58df3dd42ef9</url>

</icon>

<icon>

<mimetype>image/bmp</mimetype>

<width>48</width>

<height>48</height>

<depth>16</depth>

<url>/upnphost/udhisapi.dll?content=uuid:ac957896-5ff1-40ca-b1c8-f2a440021972</url>

</icon>

<icon>

<mimetype>image/jpeg</mimetype>

<width>32</width>

<height>32</height>

<depth>24</depth>

<url>/upnphost/udhisapi.dll?content=uuid:51c04143-22d9-4893-986c-65609f3f1125</url>

</icon>

<icon>

<mimetype>image/bmp</mimetype>

<width>32</width>

<height>32</height>

<depth>16</depth>

<url>/upnphost/udhisapi.dll?content=uuid:f5461206-8065-421d-880a-ffea012d607c</url>

</icon>

<icon>

<mimetype>image/jpeg</mimetype>

<width>120</width>

<height>120</height>

<depth>24</depth>

<url>/upnphost/udhisapi.dll?content=uuid:87a05e80-157b-4fcf-b833-a70c57787040</url>

</icon>

<icon>

<mimetype>image/png</mimetype>

<width>120</width>

<height>120</height>

<depth>24</depth>

<url>/upnphost/udhisapi.dll?content=uuid:120d4564-921c-45f4-84c4-c036ecf555ea</url>

</icon>

<icon>

<mimetype>image/jpeg</mimetype>

<width>48</width>

<height>48</height>

<depth>24</depth>

<url>/upnphost/udhisapi.dll?content=uuid:e477d0c1-5b10-4cf5-80ef-a4cba1bfadb0</url>

</icon>

<icon>

<mimetype>image/png</mimetype>

<width>48</width>

<height>48</height>

<depth>24</depth>

<url>/upnphost/udhisapi.dll?content=uuid:3d5bb291-581a-4b87-8804-97d0a5f75fdf</url>

</icon>

<icon>

<mimetype>image/bmp</mimetype>

<width>48</width>

<height>48</height>

<depth>16</depth>

<url>/upnphost/udhisapi.dll?content=uuid:7f16a70b-692b-47b4-83c6-9a49bc030fc7</url>

</icon>

<icon>

<mimetype>image/jpeg</mimetype>

<width>32</width>

<height>32</height>

<depth>24</depth>

<url>/upnphost/udhisapi.dll?content=uuid:423b7b22-8847-44d9-8bc6-aea2250eebbb</url>

</icon>

<icon>

<mimetype>image/bmp</mimetype>

<width>32</width>

<height>32</height>

<depth>16</depth>

<url>/upnphost/udhisapi.dll?content=uuid:1eac8465-30b6-4daa-a911-935487a78079</url>

</icon>

</iconList>

<serviceList>

<service>

<serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>

<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>

<control
Message longer than Log limit (4000). Message was truncated.
 

fixit30

Active Member
Licensed User
It's getting late. I'll run your code in debug mode in the morning and post the results then.

I don't run any media servers on my network. However the detected router has a USB port for a HDD. So I guess it can act as a media server?
 
Top