Announcements

Help Wizard

Step 1

NEXT STEP

Got failure when connect SpotifyAppRemote

Got failure when connect SpotifyAppRemote

May I ask if anyone has encountered any error reports:
 
com.spotify.android.appremote.api.error.CouldNotFindSpotifyApp at com.spotify.android.appremote.api.LocalConnector.connect(LocalConnector.java:52) at com.spotify.android.appremote.api.SpotifyAppRemote.connect(SpotifyAppRemote.java:73)
 
This error occurred when I tried to connect to the server to obtain the spotifyAppRemote instance after successfully logging in and authentication.
The aar versions used were spotify-app-remote-release-0.7.0.aar and spotify-auth-release-1.2.1.aar
As my code below, the connect interface returns onFailure, I have already install the Spotify app in my device.

 

 

 

private void connectToSpotifyAppRemote() {
        SpotifyAppRemote.setDebugMode(true);
        SpotifyAppRemote.connect(this, new ConnectionParams.Builder(CLIENT_ID)
                .setRedirectUri(REDIRECT_URI)
                .showAuthView(false)
                .build(), new Connector.ConnectionListener() {
            @Override
            public void onConnected(SpotifyAppRemote spotifyAppRemote) {
                mSpotifyAppRemote = spotifyAppRemote;
                // Play a playlist
                mSpotifyAppRemote.getPlayerApi().play("spotify:playlist:37i9dQZF1DX2sUQwD7tbmL");

                // Subscribe to PlayerState
                mSpotifyAppRemote.getPlayerApi()
                        .subscribeToPlayerState()
                        .setEventCallback(playerState -> {
                            final Track track = playerState.track;
                            if (track != null) {
                            }
                        });
            }

            @Override
            public void onFailure(Throwable throwable) {
            }
        });
    }

 

 

 

How can I resolve this issue?
Reply
0 Replies

Suggested posts