Login failed in Spotify Android SDK tutorial

1.5k views Asked by At

I'm trying to complete the beginner's tutorial for android sdk. I've made all the passage and no build errors occours, however launching the app, when I try to authenticate with facebook, in the logcat, I found "login failed"

06-21 18:34:39.282  14033-14033/com.example.lucabrognara.spotify_prova D/MainActivity﹕ Login failed

Here the complete log

06-21 18:34:34.642  14033-14033/? D/dalvikvm﹕ Late-enabling CheckJNI
06-21 18:34:34.877  14033-14033/com.example.lucabrognara.spotify_prova D/libEGL﹕ loaded /system/lib/egl/libEGL_mali.so
06-21 18:34:34.897  14033-14033/com.example.lucabrognara.spotify_prova D/libEGL﹕ loaded /system/lib/egl/libGLESv1_CM_mali.so
06-21 18:34:34.902  14033-14033/com.example.lucabrognara.spotify_prova D/libEGL﹕ loaded /system/lib/egl/libGLESv2_mali.so
06-21 18:34:34.907  14033-14033/com.example.lucabrognara.spotify_prova D/﹕ Device driver API match
    Device driver API version: 10
    User space API version: 10
06-21 18:34:34.907  14033-14033/com.example.lucabrognara.spotify_prova D/﹕ mali: REVISION=Linux-r2p4-02rel0 BUILD_DATE=Thu Oct 25 08:43:05 KST 2012
06-21 18:34:34.932  14033-14033/com.example.lucabrognara.spotify_prova D/OpenGLRenderer﹕ Enabling debug mode 0
06-21 18:34:35.032  14033-14033/com.example.lucabrognara.spotify_prova I/webclipboard﹕ clipservice: android.sec.clipboard.ClipboardExManager@41b7b0d0
06-21 18:34:35.112  14033-14034/com.example.lucabrognara.spotify_prova D/dalvikvm﹕ GC_CONCURRENT freed 158K, 13% free 9649K/11079K, paused 14ms+12ms, total 45ms
06-21 18:34:35.117  14033-14033/com.example.lucabrognara.spotify_prova D/WebView﹕ loadUrlImpl: called
06-21 18:34:35.137  14033-14050/com.example.lucabrognara.spotify_prova V/webkit﹕ BrowserFrame constructor: this=Handler (android.webkit.BrowserFrame) {41b75b88}
06-21 18:34:35.182  14033-14033/com.example.lucabrognara.spotify_prova D/WebView﹕ onSizeChanged - w:442 h:724
06-21 18:34:35.187  14033-14050/com.example.lucabrognara.spotify_prova D/webcore﹕ CORE loadUrl: called
06-21 18:34:35.187  14033-14050/com.example.lucabrognara.spotify_prova D/webkit﹕ Firewall not null
06-21 18:34:35.192  14033-14050/com.example.lucabrognara.spotify_prova D/webkit﹕ euler: isUrlBlocked = false
06-21 18:34:35.332  14033-14033/com.example.lucabrognara.spotify_prova W/ResourceType﹕ Failure getting entry for 0x010802c0 (t=7 e=704) in package 0 (error -75)
06-21 18:34:35.382  14033-14034/com.example.lucabrognara.spotify_prova D/dalvikvm﹕ GC_CONCURRENT freed 109K, 13% free 9945K/11335K, paused 13ms+3ms, total 44ms
06-21 18:34:38.377  14033-14033/com.example.lucabrognara.spotify_prova D/WebCore﹕ uiOverrideUrlLoading: shouldOverrideUrlLoading() returnstrue
06-21 18:34:38.377  14033-14050/com.example.lucabrognara.spotify_prova I/GATE﹕ <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
06-21 18:34:38.432  14033-14033/com.example.lucabrognara.spotify_prova D/dalvikvm﹕ DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_ABIS
06-21 18:34:38.432  14033-14033/com.example.lucabrognara.spotify_prova W/dalvikvm﹕ VFY: unable to resolve static field 78 (SUPPORTED_ABIS) in Landroid/os/Build;
06-21 18:34:38.432  14033-14033/com.example.lucabrognara.spotify_prova D/dalvikvm﹕ VFY: replacing opcode 0x62 at 0x000d
06-21 18:34:38.432  14033-14033/com.example.lucabrognara.spotify_prova D/dalvikvm﹕ DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_ABIS
06-21 18:34:38.432  14033-14033/com.example.lucabrognara.spotify_prova I/dalvikvm﹕ DexOpt: unable to optimize static field ref 0x004e at 0x17 in Lcom/spotify/sdk/android/player/Config;.createOsVersionString
06-21 18:34:38.442  14033-14033/com.example.lucabrognara.spotify_prova W/ApplicationContext﹕ Unable to create external files directory
06-21 18:34:38.452  14033-14033/com.example.lucabrognara.spotify_prova I/dalvikvm﹕ Could not find method android.media.AudioTrack.setVolume, referenced from method com.spotify.sdk.android.player.AudioTrackController.createAudioTrack
06-21 18:34:38.452  14033-14033/com.example.lucabrognara.spotify_prova W/dalvikvm﹕ VFY: unable to resolve virtual method 694: Landroid/media/AudioTrack;.setVolume (F)I
06-21 18:34:38.452  14033-14033/com.example.lucabrognara.spotify_prova D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x004c
06-21 18:34:38.457  14033-14033/com.example.lucabrognara.spotify_prova D/dalvikvm﹕ Trying to load lib /data/data/com.example.lucabrognara.spotify_prova/lib/libgnustl_shared.so 0x41b2f108
06-21 18:34:38.457  14033-14033/com.example.lucabrognara.spotify_prova D/dalvikvm﹕ Added shared lib /data/data/com.example.lucabrognara.spotify_prova/lib/libgnustl_shared.so 0x41b2f108
06-21 18:34:38.457  14033-14033/com.example.lucabrognara.spotify_prova D/dalvikvm﹕ No JNI_OnLoad found in /data/data/com.example.lucabrognara.spotify_prova/lib/libgnustl_shared.so 0x41b2f108, skipping init
06-21 18:34:38.457  14033-14033/com.example.lucabrognara.spotify_prova D/dalvikvm﹕ Trying to load lib /data/data/com.example.lucabrognara.spotify_prova/lib/libspotify_embedded_shared.so 0x41b2f108
06-21 18:34:38.462  14033-14033/com.example.lucabrognara.spotify_prova D/dalvikvm﹕ Added shared lib /data/data/com.example.lucabrognara.spotify_prova/lib/libspotify_embedded_shared.so 0x41b2f108
06-21 18:34:38.462  14033-14033/com.example.lucabrognara.spotify_prova D/dalvikvm﹕ No JNI_OnLoad found in /data/data/com.example.lucabrognara.spotify_prova/lib/libspotify_embedded_shared.so 0x41b2f108, skipping init
06-21 18:34:38.462  14033-14033/com.example.lucabrognara.spotify_prova D/dalvikvm﹕ Trying to load lib /data/data/com.example.lucabrognara.spotify_prova/lib/libspotify_sdk.so 0x41b2f108
06-21 18:34:38.462  14033-14033/com.example.lucabrognara.spotify_prova D/dalvikvm﹕ Added shared lib /data/data/com.example.lucabrognara.spotify_prova/lib/libspotify_sdk.so 0x41b2f108
06-21 18:34:38.507  14033-14033/com.example.lucabrognara.spotify_prova E/SpannableStringBuilder﹕ SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
06-21 18:34:38.507  14033-14033/com.example.lucabrognara.spotify_prova E/SpannableStringBuilder﹕ SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
06-21 18:34:38.527  14033-14120/com.example.lucabrognara.spotify_prova D/SpotifySDK﹕ Use diskcache: true
06-21 18:34:38.527  14033-14120/com.example.lucabrognara.spotify_prova E/SpotifySDK﹕ Cache path '' is not writeable
06-21 18:34:38.532  14033-14120/com.example.lucabrognara.spotify_prova I/SpotifySDK﹕ Got notification: Became active playing device
06-21 18:34:38.532  14033-14033/com.example.lucabrognara.spotify_prova D/MainActivity﹕ Playback event received: BECAME_ACTIVE
06-21 18:34:38.532  14033-14120/com.example.lucabrognara.spotify_prova I/SpotifySDK﹕ playbackCallbackOnSeek (to 0ms)
06-21 18:34:39.282  14033-14033/com.example.lucabrognara.spotify_prova D/MainActivity﹕ Login failed
06-21 18:35:17.487  14033-14034/com.example.lucabrognara.spotify_prova D/dalvikvm﹕ GC_CONCURRENT freed 207K, 13% free 10160K/11655K, paused 8ms+12ms, total 92ms
06-21 18:35:17.492  14033-14033/com.example.lucabrognara.spotify_prova D/webviewglue﹕ nativeDestroy view: 0x4db6e608

Any idea to fix this issue? I've already try to delete the app from my facebook account but nothig, always "Login failed"

Update 1

I've print the message of the exception lauch the onLoginFailed method:

06-21 18:53:59.362  28201-28201/com.example.lucabrognara.spotify_prova D/MainActivity﹕ Login failed: The operation requires a Spotify Premium account

I'm not sure why for login I need a premium account...

Update 2

I've explicitally asked for a test account and the answer, I guess, close this question:

Q: "There's a way to use a test account? I'm developing an android app and i need spotify authentication"

A: "@lucabro no, I'm afraid you need to have a Spotify Premium account to be able to use this SDK"

2

There are 2 answers

2
UtsavShah On

Spotify doesn't seem to allow free users, not sure though

EDIT: Yeah they do need a premium account as of now, as you found out.

https://github.com/spotify/android-sdk/issues/49

0
Gabriel Cuenca On

Spotify API access has different scopes to gather information , and one or more of them , need premium account. I think you should be trying to access the scope " streaming ," which is premium .

Check your line :

builder.setScopes (new String [ ] { "scopeexample1", "scopeexample2" } ) ;