question

2kit consulting avatar image
2kit consulting asked

Fling Discovery/Connection error on Android 11 when compiled with target 30 or higher

Dear Amazon,

We have noticed a very serious issue that breaks the whole Fling SDK and communication between Android devices and Fire TV devices.


IMPORTANT!

This affects all Android Apps with Amazon Fling that are compiled with targetSdkVersion=30 (or higher) and run on a device with Android 11 (or higher). To underline the urgency of this issue, please note that starting from 11/2021, Google will force all Android Developers to compile their apps with at least targetSdkVersion=30, if they want to update the app on Google Play. This means that any app using Fling SDK will break on Android 11 devices at that point. Android 11 currently has a market share of 25% so this would mean a devastating outcome for all apps that use Fling.


We have seen on this forum that this issue has been reported in the past, but only for specific devices, such as Fire TV 4K:

https://amazon.developer.forums.answerhub.com/questions/196399/fling-with-firetv-stick-4k.html


But please do not consider this post as a duplicate, because our tests have shown that ALL Fire TV devices (including the oldest models) are now affected by this issue, probably due to the latest Fire OS updates. And now everything is broken, starting with the connection. So it is not even possible to send data to Fire TV.


The following stacktrace shows what we have found so far. The issue seems to be caused by WhisperPlay.jar, specifically the classes:

- JmdnsServiceManager

- DiscoveryManager

- Connection

- TTransportManager

The device object seems to be null


D/WhisperLink: JmdnsServiceListener - Service Added: Service Name: amzn.dmgr:112836567BF632447AAC86BD35354F1C:xnVDMM+4u1:705923 
D/WhisperLink: JmdnsServiceManager - processServiceAdded amzn.dmgr:112836567BF632447AAC86BD35354F1C:xnVDMM+4u1:705923 Unknown record.
D/WhisperLink: ThreadUtils - Start WP_2_WhisperPlayMainThread_0(JmdnsManager_resolve)
I/WhisperLink: JmdnsManager - Requesting to resolve service Service Type: _amzn-wplay._tcp.local. Service Name: amzn.dmgr:112836567BF632447AAC86BD35354F1C:xnVDMM+4u1:705923 Subtype: 
D/WhisperLink: ThreadUtils - End WP_2_WhisperPlayMainThread_0(JmdnsManager_resolve)
D/WhisperLink: JmdnsServiceListener - Service Resolved: Service Name: amzn.dmgr:112836567BF632447AAC86BD35354F1C:xnVDMM+4u1:705923 Service Type:  _amzn-wplay._tcp.local.
D/WhisperLink: ThreadUtils - Start WP_1_WPWorker_0(JmDNS_resolve_amzn.dmgr:112836567BF632447AAC86BD35354F1C:xnVDMM+4u1:705923)
I/WhisperLink: JmdnsServiceManager - Device info only or hash unknown, exchange services
I/WhisperLink: DiscoveryManager - deviceFound(): uuid=[device: local=false, uuid=112836567BF632447AAC86BD35354F1C] explorer=mdns updated=true
D/WhisperLink: DiscoveryUtil - Exchange services Attempt: 0
D/WhisperLink: Connection - Connection Attempt #:0: Excluded transports :[]
D/WhisperLink: Connection - doConnectOnce, device=[device: local=false, uuid=112836567BF632447AAC86BD35354F1C, routes={inet=Route(ipv4:192.168.26.148, unsecurePort:51209, securePort:57247)}], service=Description(sid:amzn.dmgr, friendlyName:null, accessLevel:0, security:0, flags:0, version:2, minSupportedVersion:2), protocol=null, channel=null; excluded=[]
D/WhisperLink: Connection - Connection Attempt #:0: Excluded transports :[]
D/WhisperLink: Connection - doConnectOnce, device=[device=null], service=Description(sid:amzn.reg, friendlyName:null, accessLevel:3, security:0, flags:0, version:1), protocol=null, channel=null; excluded=[]
D/WhisperLink: TTransportManager - Get transport for local device amzn.reg
D/WhisperLink: Connection - Returning a cache transport for amzn.reg
D/WhisperLink: Connection - calling Connection.close for device() [device=null]
D/WhisperLink: TTransportManager - Get transport for remote device amzn.dmgr; channel:null
D/WhisperLink: TTransportManager - Getting external transport for channel:inet: Channel connected? :false: ext channel :com.amazon.whisperlink.port.android.transport.TExternalSocketFactory@dcf957a
E/WhisperLink: TTransportManager - Unable to get external transport, channel factory is null, channel=null
D/WhisperLink: Connection - Exception in connection:null
    com.amazon.whisperlink.exception.WPTException
        at com.amazon.whisperlink.util.Connection.doConnectOnce(Connection.java:672)
        at com.amazon.whisperlink.util.Connection.doConnect(Connection.java:586)
        at com.amazon.whisperlink.util.Connection.doConnect(Connection.java:536)
        at com.amazon.whisperlink.util.Connection.connect(Connection.java:379)
        at com.amazon.whisperlink.internal.util.DiscoveryUtil.exchangeServicesAndGetDeviceServices(DiscoveryUtil.java:139)
        at com.amazon.whisperlink.internal.util.DiscoveryUtil.exchangeDeviceServices(DiscoveryUtil.java:316)
        at com.amazon.whisperlink.core.android.explorers.JmdnsServiceManager.propagateChanges(JmdnsServiceManager.java:214)
        at com.amazon.whisperlink.core.android.explorers.JmdnsServiceManager.processServiceResolved(JmdnsServiceManager.java:174)
        at com.amazon.whisperlink.core.android.explorers.JmdnsServiceListener$1.run(JmdnsServiceListener.java:100)
        at com.amazon.whisperlink.util.ThreadUtils$2.run(ThreadUtils.java:151)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
E/WhisperLink: DiscoveryUtil - Failed to obtain device information for :112836567BF632447AAC86BD35354F1C. Adding to failed devices list
    com.amazon.whisperlink.exception.WPTException: com.amazon.whisperlink.exception.WPTException
        at com.amazon.whisperlink.util.Connection.throwIfNetworkError(Connection.java:791)
        at com.amazon.whisperlink.util.Connection.doConnectOnce(Connection.java:712)
        at com.amazon.whisperlink.util.Connection.doConnect(Connection.java:586)
        at com.amazon.whisperlink.util.Connection.doConnect(Connection.java:536)
        at com.amazon.whisperlink.util.Connection.connect(Connection.java:379)
        at com.amazon.whisperlink.internal.util.DiscoveryUtil.exchangeServicesAndGetDeviceServices(DiscoveryUtil.java:139)
        at com.amazon.whisperlink.internal.util.DiscoveryUtil.exchangeDeviceServices(DiscoveryUtil.java:316)
        at com.amazon.whisperlink.core.android.explorers.JmdnsServiceManager.propagateChanges(JmdnsServiceManager.java:214)
        at com.amazon.whisperlink.core.android.explorers.JmdnsServiceManager.processServiceResolved(JmdnsServiceManager.java:174)
        at com.amazon.whisperlink.core.android.explorers.JmdnsServiceListener$1.run(JmdnsServiceListener.java:100)
        at com.amazon.whisperlink.util.ThreadUtils$2.run(ThreadUtils.java:151)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
     Caused by: com.amazon.whisperlink.exception.WPTException
        at com.amazon.whisperlink.util.Connection.doConnectOnce(Connection.java:672)
        at com.amazon.whisperlink.util.Connection.doConnect(Connection.java:586) 
        at com.amazon.whisperlink.util.Connection.doConnect(Connection.java:536) 
        at com.amazon.whisperlink.util.Connection.connect(Connection.java:379) 
        at com.amazon.whisperlink.internal.util.DiscoveryUtil.exchangeServicesAndGetDeviceServices(DiscoveryUtil.java:139) 
        at com.amazon.whisperlink.internal.util.DiscoveryUtil.exchangeDeviceServices(DiscoveryUtil.java:316) 
        at com.amazon.whisperlink.core.android.explorers.JmdnsServiceManager.propagateChanges(JmdnsServiceManager.java:214) 
        at com.amazon.whisperlink.core.android.explorers.JmdnsServiceManager.processServiceResolved(JmdnsServiceManager.java:174) 
        at com.amazon.whisperlink.core.android.explorers.JmdnsServiceListener$1.run(JmdnsServiceListener.java:100) 
        at com.amazon.whisperlink.util.ThreadUtils$2.run(ThreadUtils.java:151) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:923) 


Any help and an update to the WhisperPlay.jar file would be great.

Thank you very much in advance.

amazon fling
1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Confirming this is a show stopping error for us. We would appreciate any insight into this we can gain.

Thanks!

0 Likes 0 ·

1 Answer

Carlos Solorzano avatar image
Carlos Solorzano answered

I see some apps have it working on Android 12, anyone have any idea how they did it?


10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.