Amazon Fling Cannot install product from remote install service

Viewed 85

Utilizing the over a half decade old technology for interacting with Fire TV devices from a mobile app, I am yet again running into a block that the non-existent documentation provides no solution for.

Utilizing these docs as a reference: https://developer.amazon.com/docs/fling/android-remote-install.html#installing-apps-with-remoteinstallservice

The issue: When attempting to get the installed package version via android: checkInstalledPackageVersion() (which is what is in the jar vs the provided example)

I get the following error:

checkInstalledPackageVersion() ExecutionException
03-28 10:10:21.323  2782  3791 V AmazonFlingModule: java.util.concurrent.ExecutionException: java.io.IOException: Cannot get installed package version from remote install service
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at java.util.concurrent.FutureTask.report(FutureTask.java:123)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at java.util.concurrent.FutureTask.get(FutureTask.java:193)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at com.vidangel.thechosen.AmazonFlingModule$3.futureIsNow(AmazonFlingModule.java:91)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at com.amazon.whisperplay.install.impl.RemoteInstallServiceImpl$AsyncFutureTask.done(RemoteInstallServiceImpl.java:235)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at java.util.concurrent.FutureTask.run(FutureTask.java:271)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at java.lang.Thread.run(Thread.java:920)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule: Caused by: java.io.IOException: Cannot get installed package version from remote install service
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at com.amazon.whisperplay.install.impl.RemoteInstallServiceImpl$3.call(RemoteInstallServiceImpl.java:166)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     ... 3 more
03-28 10:10:21.323  2782  3791 V AmazonFlingModule: Caused by: com.amazon.whisperlink.exception.WPTException: com.amazon.whisperlink.exception.WPTException
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at com.amazon.whisperlink.util.Connection.throwIfNetworkError(Connection.java:804)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at com.amazon.whisperlink.util.Connection.doConnectOnce(Connection.java:725)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at com.amazon.whisperlink.util.Connection.doConnect(Connection.java:587)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at com.amazon.whisperlink.util.Connection.doConnect(Connection.java:537)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at com.amazon.whisperlink.util.Connection.connect(Connection.java:380)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at com.amazon.whisperplay.install.impl.RemoteInstallServiceImpl$3.call(RemoteInstallServiceImpl.java:156)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     ... 4 more
03-28 10:10:21.323  2782  3791 V AmazonFlingModule: Caused by: com.amazon.whisperlink.exception.WPTException
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     at com.amazon.whisperlink.util.Connection.doConnectOnce(Connection.java:679)
03-28 10:10:21.323  2782  3791 V AmazonFlingModule:     ... 8 more

Also when attempting to just run the install via installByASIN() (which is what is in the jar vs the provided example), I get the following error:

installPackage() ExecutionException
03-28 10:10:27.801  2782  3791 V AmazonFlingModule: java.util.concurrent.ExecutionException: java.io.IOException: Cannot install product from remote install service
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at java.util.concurrent.FutureTask.report(FutureTask.java:123)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at java.util.concurrent.FutureTask.get(FutureTask.java:193)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at com.vidangel.thechosen.AmazonFlingModule$4.futureIsNow(AmazonFlingModule.java:114)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at com.amazon.whisperplay.install.impl.RemoteInstallServiceImpl$AsyncFutureTask.done(RemoteInstallServiceImpl.java:235)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at java.util.concurrent.FutureTask.run(FutureTask.java:271)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at java.lang.Thread.run(Thread.java:920)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule: Caused by: java.io.IOException: Cannot install product from remote install service
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at com.amazon.whisperplay.install.impl.RemoteInstallServiceImpl$3.call(RemoteInstallServiceImpl.java:166)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     ... 3 more
03-28 10:10:27.801  2782  3791 V AmazonFlingModule: Caused by: com.amazon.whisperlink.exception.WPTException: com.amazon.whisperlink.exception.WPTException
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at com.amazon.whisperlink.util.Connection.throwIfNetworkError(Connection.java:804)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at com.amazon.whisperlink.util.Connection.doConnectOnce(Connection.java:725)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at com.amazon.whisperlink.util.Connection.doConnect(Connection.java:587)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at com.amazon.whisperlink.util.Connection.doConnect(Connection.java:537)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at com.amazon.whisperlink.util.Connection.connect(Connection.java:380)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at com.amazon.whisperplay.install.impl.RemoteInstallServiceImpl$3.call(RemoteInstallServiceImpl.java:156)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     ... 4 more
03-28 10:10:27.801  2782  3791 V AmazonFlingModule: Caused by: com.amazon.whisperlink.exception.WPTException
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     at com.amazon.whisperlink.util.Connection.doConnectOnce(Connection.java:679)
03-28 10:10:27.801  2782  3791 V AmazonFlingModule:     ... 8 more

I am able to get the remoteInstallService successfully via installServiceDiscovered(), and is returned as such:

selectedFireTV: Fire TV stick (xxxxxxxF003F5E36C561A8A99xxxxxxx)
// selectedFireTV is the RemoteInstallService

Can anyone make heads or tails of this and has anyone successfully implemented this tech in the last year or so?

As always any and all direction is appreciated, so thanks in advance!

1 Answers

I helped implement this library. You're in for a ride. Open a ticket here: https://github.com/Unofficial-Whisperplay-Fling-Helpline/wp/issues

Can anyone make heads or tails of this and has anyone successfully implemented this tech in the last year or so?

If I had to guess, I'd say no, but I've been wrong before.

Note: Other folks have had issues integrating with FlingSDK on Android 11. Raising issues directly with Amazon support might be a good way to get a response.

https://github.com/ConnectSDK/Connect-SDK-Android-FireTV/issues/7

Edit 2: From the logs, it looks like a networking/connectivity error, so it's not a surprise it would fail in the same way for both operations. So, it somehow knows the other device is supposed to exist, but it encounters a connection error every time it actually talks to it.

As far as what information the SDK is getting to make it believe the device exists, that's a whole other rabbit hole.

Edit 3: You're having the same problem as https://github.com/ConnectSDK/Connect-SDK-Android-FireTV/issues/7 . Go complain to Amazon, it's probably your only hope.

Find me at http://github.com/ubuvoid .

Related