'Spotify Authentication auth_service_unavailable

I am trying to login to spotify. Although when the app is installed it always throws an AUTHENTICATION_SERVICE_UNAVAILABLE error. If the app is uninstalled the default Webview opens where the login works fine. Wished behaviour is, that the app opens and the user can login from there.

    public void doSpotifyLogin(boolean trySpotifyAgain) {
    this.trySpotifyAgain = trySpotifyAgain;
    AuthorizationRequest.Builder builder =
            new AuthorizationRequest.Builder(CLIENT_ID, AuthorizationResponse.Type.TOKEN, REDIRECT_URI);
    builder.setScopes(new String[]{"user-read-private", "streaming", "playlist-read-private", "user-library-read"});
    AuthorizationRequest request = builder.build();

    AuthorizationClient.openLoginActivity(this, SPOTIFY_LOGIN_REQUEST_CODE, request);
}

This is the response I am getting from the API:

2021-12-22 11:36:29.802 5069-5069/? I/com.spotify.sdk.android.auth.LoginActivity: Spotify auth completing. The response is in EXTRA with key 'response'
2021-12-22 11:36:29.822 5069-5069/? D/StartActivity: Spotify error: AUTHENTICATION_SERVICE_UNAVAILABLE

If you need any further information, please let me know! Thanks in advance



Solution 1:[1]

Ronze's comment worked for me. I needed to update my app's package name on developer.spotify.com.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kuroki