android-sdk
android-sdk copied to clipboard
SpotifyConnectionTerminatedException - App looses Spotify connection after some time
In our app and also in the app-remote-sample app, provided by Spotify, a SpotifyConnectionTerminatedException is thrown approx. 5 minutes after app start. It seems that the app disconnects from Spotify automatically after some time and you have to connect again. What triggers this Exception? Why is it triggered? How can we prevent such a "random" connection loss?
Issue found on 29.03.2020 Spotify-app-remote-release-0.7.0 Spotify-auth-release-1.2.1
OS Version:
Android 8.0.0
Steps to reproduce:
- Connect to Spotify
- Put break point in "onFailure" method of SpotifyAppRemote.connect() method
- Wait for approx. 5 minutes
Expected behaviour:
OnFailure is not triggered every 5 minutes
Actual behaviour:
OnFailure is triggered every 5 minutes...
I also encountered the same problem,but OnFailure is triggered every 10 minutes...
the excetpion:
com.spotify.android.appremote.api.error.SpotifyConnectionTerminatedException at com.spotify.android.appremote.api.LocalConnector$1.lambda$onConnected$0(LocalConnector.java:88) at com.spotify.android.appremote.api.-$$Lambda$LocalConnector$1$IbZLttZmA0yUOwLQJq9O0FFxzoA.onConnectionTerminated(lambda) at com.spotify.protocol.client.RemoteWampClient$1.onGoodbye(RemoteWampClient.java:52) at com.spotify.protocol.client.WampRouterImpl.routeGoodbye(WampRouterImpl.java:107) at com.spotify.protocol.client.WampRouterImpl.route(WampRouterImpl.java:30) at com.spotify.protocol.client.AppProtocolCommunicator.onData(AppProtocolCommunicator.java:78) at com.spotify.android.appremote.internal.RemoteServiceIo.handleMessage(RemoteServiceIo.java:113) at com.spotify.android.appremote.internal.RemoteServiceIo.access$000(RemoteServiceIo.java:47) at com.spotify.android.appremote.internal.RemoteServiceIo$IncomingHandler.handleMessage(RemoteServiceIo.java:91) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5682) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:982) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:777)
I have the same issue after 10'. Should we renew the connection beforehand?
Maybe this will help you https://github.com/spotify/android-sdk/issues/233#issuecomment-627943835