Help Wizard

Step 1



Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...


Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...


Bug at Spotify App Remote library to control spotify via voice

Bug at Spotify App Remote library to control spotify via voice

*Hi, we are trying to use Spotify App Remote library to control spotify via voice control inside our application.
Our issue is that from time to time, SpotifyAppRemote.connect fails to connect or report an exception. It seems that Spotify's service gets in a 'stuck' state where it cannot respond back to client apps.
When this happens, trying to drop / reconnect does not resolve the issue, but a new connection seem to happen, which is then immediately problematic (same stuck state). After some indeterminate time that varies from some seconds to several minutes, the situation seems to fix it self, and at that point a number of disconnection and timeout exceptions are reported one after the other for the previously made connection attempts.

Bringing Spotify in the foreground, restarting the app, or killing the background service does not seem to help.

This makes the sdk unusable for us, could you investigate?

Some code attached bellow:

Issue found on 07.JUL.23.

SDK Version: 0.8.0, 0.7.2

OS Version: 11, 12, 13

Code Sample:

We initially (once / on app install) use the following code to get app-remote-control and authorise our app

val builder = AuthorizationRequest.Builder(CLIENT_ID, AuthorizationResponse.Type.CODE, REDIRECT_URI) builder.setScopes( arrayOf( "streaming", "app-remote-control", "user-read-email", "user-read-private", "user-read-playback-state", "user-modify-playback-state", "user-top-read", "user-follow-modify", "user-library-modify", "user-read-currently-playing", "user-read-recently-played" ) ) val request = AuthorizationClient.openLoginActivity(this, REQUEST_CODE, request)

As soon as we have a result in onActivityResult, following code is used to access the remote control (and on further app uses):

val connectionParams = ConnectionParams.Builder(CLIENT_ID) .setRedirectUri(REDIRECT_URI) .showAuthView(false) .build() SpotifyAppRemote.connect( this, connectionParams, object : Connector.ConnectionListener { override fun onConnected(appRemote: SpotifyAppRemote) { ... //get and use the remote } override fun onFailure(throwable: Throwable) { when (throwable) { is CouldNotFindSpotifyApp -> { Toast.makeText(applicationContext, "SPT Please install Spotify first!", Toast.LENGTH_LONG).show() } is UserNotAuthorizedException -> { authorizeAndGetSpotifyCodeViaActivityResult() } is SpotifyConnectionTerminatedException -> { Timber.e("SPT Connection was dropped! Trying reconnecting here!") } else -> Timber.e(throwable, "SPT Spotify onFailure!") } } } )

Steps to reproduce: sometimes works others not, we have not found a way to constantly break it or use it

Expected behaviour:

App connects or an exception is given

Actual behaviour:

App gets stuck waiting for a connection or exception

Would be awesome to get some help from you
Best Philipp


2 Replies

I don't know how to fix your problem, but the Spotify Developer Policy says: "Do not create a voice-enabled SDA that enables a user to control Spotify with their voice, or any kind of voice assistant that provides voice-control functionality."

Thanks for the info. That seems to be the case but this is an user case/app use case issue. Still the bug exists and the real problem. 

Suggested posts