Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

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

Loading issue...

Loading ongoing issues...

VIEW ALL

Spotify Android SDK: Error while running the sample application

Spotify Android SDK: Error while running the sample application

My Question or Issue

Spotify Android SDK offer two libraries - App Remote and Authentication. There are sample application available on the github which is using these two libraries - github - Spotify Sample Application

 

I have created two different android emulator with the below device configurations.

 

The sample application is running without any issues in the Pixel_4_API_28 device.

 

Device Specification:

  1. Name: Pixel_4_API_28
  2. CPU/ABI: Google PlayStore Intel Atom (x86)
  3. Target: google_apis_playstore [Google PlayStore] (API level 28)
  4. Skin: pixel_4
  5. hw.device.name: pixel_4
  6. hw.lcd.height: 2280
  7. hw.lcd.width: 1080
  8. hw.lcd.density: 440
  9. PlayStore.enabled: true
  10. image.sysdir.1: system-images\android-28\google_apis_playstore\x86\

However, I am receiving the error while running the same application in the Automotive Virtual Device.

 

Device Specification:

  1. Name: Automotive_Virtual_Device
  2. CPU/ABI: Automotive Intel Atom (x86)
  3. Target: android-automotive-playstore [Automotive] (API level 28)
  4. Skin: 1080x1920
  5. hw.device.name: automotive_1024p_landscape
  6. hw.lcd.height: 1920
  7. hw.lcd.width: 1080
  8. hw.lcd.density: 190
  9. PlayStore.enabled: true
  10. image.sysdir.1: system-images\android-28\android-automotive-playstore\x86\

Error Details:

 

 

 

 

E/com.spotify.sdk.android.auth.webview.LoginDialog: Can't redirect due to mismatch. 
Request redirect-uri: com.example.khmusic://callback/
Response redirect-uri: https://accounts.google.com/o/oauth2/v2/auth?response_type=code&access_type=offline&client_id=1046568431490-ij1gi5shcp2gtorls09frkc56d4mjbe2.apps.googleusercontent.com&state=AQB%2Bj3iIVPBTqhQ6rhcDkmzDsgoFbxzGrQXd%2Bm5jO8mG%2F9Otq%2F%2FYFMS5NJOS3HgHfBQDxP9BCdDYIJpGN7WPsWpe7imosodu%2BZWB%2Biopw7FelY%2F83J8QUF3gLp9EVEvG7p%2BVcgJOecJ6%2FatcihQ31HRiOjdOPPM7vZBF0HRpUcpPnMaoZ3Udv8fRWhjZa3qL5icJYQp%2BGIz4iJ%2BOsdXSbcgDi0Gl3sjvCzTAWxGlOuVer51IjAez%2Fyw0eNIx%2B0PX97nabbjPLDyxRRdtPOQyNlNuJii9%2B8nTv0au7uJxZKJ2apXuwex5uQccfr1bCoIPTXZtr7Ij8Wo5yukP4VRzPvwJqXgA3qNIIwIyBUbkeXvRfmIEhdu730FTvALHfQbXK%2FFVnLXX9NMkAmu9m5%2FBEzNTFy6RxgTaR1Ej6GiZY5aQOmJzGnqGaCmXcGM2NBFv%2B7JTqbLAm%2B9g%2Blr8ZVNRC47tsBtBtRB6ToIahgdGcEk79%2FjQaU9PQHjPJv88cRWAOlbNJJ%2BWCaB%2FhMj2fg3ZuTH1UcnVbLoTDi1InmNqm4HOb%2Bz4rrecFvqnOkCRYqu7m1akMChP%2FnhAB9reL0%2BklrONO7IExcuO1hGvciGItWGt%2B2eVGHOGy%2F4hqFrVfgMekZL63diWskYLf0q7g3b2EsG6UHRTQ4iT8u9QLUr4srIukufc3N%2B5t6g%2FpOj9ZXbbpHiLmMNmH3J0yvGgIzNrziNrh8DZquXhCWpgJpp31NvZSM%2F0FQsEcQP0uP8dPIF7XoUVbRW4DBPmy2ZBJT8EMgCr4XMUvkqCeS37rNGZTn9%2FvoyyjhOSlZiexPSFP02ipfhB4fOQSgSeBOX5aRff1YSy8uWZzg%3D%3D&scope=profile+email+openid&redirect_uri=https%3A%2F%2Faccounts.spotify.com%2Flogin%2Fgoogle%2Fredirect E/Spotify Auth Client: Spotify auth Error
java.lang.RuntimeException: Can't redirect due to mismatch. 
Request redirect-uri: com.example.khmusic://callback/
Response redirect-uri: https://accounts.google.com/o/oauth2/v2/auth?response_type=code&access_type=offline&client_id=1046568431490-ij1gi5shcp2gtorls09frkc56d4mjbe2.apps.googleusercontent.com&state=AQB%2Bj3iIVPBTqhQ6rhcDkmzDsgoFbxzGrQXd%2Bm5jO8mG%2F9Otq%2F%2FYFMS5NJOS3HgHfBQDxP9BCdDYIJpGN7WPsWpe7imosodu%2BZWB%2Biopw7FelY%2F83J8QUF3gLp9EVEvG7p%2BVcgJOecJ6%2FatcihQ31HRiOjdOPPM7vZBF0HRpUcpPnMaoZ3Udv8fRWhjZa3qL5icJYQp%2BGIz4iJ%2BOsdXSbcgDi0Gl3sjvCzTAWxGlOuVer51IjAez%2Fyw0eNIx%2B0PX97nabbjPLDyxRRdtPOQyNlNuJii9%2B8nTv0au7uJxZKJ2apXuwex5uQccfr1bCoIPTXZtr7Ij8Wo5yukP4VRzPvwJqXgA3qNIIwIyBUbkeXvRfmIEhdu730FTvALHfQbXK%2FFVnLXX9NMkAmu9m5%2FBEzNTFy6RxgTaR1Ej6GiZY5aQOmJzGnqGaCmXcGM2NBFv%2B7JTqbLAm%2B9g%2Blr8ZVNRC47tsBtBtRB6ToIahgdGcEk79%2FjQaU9PQHjPJv88cRWAOlbNJJ%2BWCaB%2FhMj2fg3ZuTH1UcnVbLoTDi1InmNqm4HOb%2Bz4rrecFvqnOkCRYqu7m1akMChP%2FnhAB9reL0%2BklrONO7IExcuO1hGvciGItWGt%2B2eVGHOGy%2F4hqFrVfgMekZL63diWskYLf0q7g3b2EsG6UHRTQ4iT8u9QLUr4srIukufc3N%2B5t6g%2FpOj9ZXbbpHiLmMNmH3J0yvGgIzNrziNrh8DZquXhCWpgJpp31NvZSM%2F0FQsEcQP0uP8dPIF7XoUVbRW4DBPmy2ZBJT8EMgCr4XMUvkqCeS37rNGZTn9%2FvoyyjhOSlZiexPSFP02ipfhB4fOQSgSeBOX5aRff1YSy8uWZzg%3D%3D&scope=profile+email+openid&redirect_uri=https%3A%2F%2Faccounts.spotify.com%2Flogin%2Fgoogle%2Fredirect
    at com.spotify.sdk.android.auth.webview.LoginDialog$2.shouldOverrideUrlLoading(LoginDialog.java:175)
    at android.webkit.WebViewClient.shouldOverrideUrlLoading(WebViewClient.java:83)
    at Cs.a(PG:1)
    at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(PG:16)
    at android.os.MessageQueue.nativePollOnce(Native Method)
    at android.os.MessageQueue.next(MessageQueue.java:326)
    at android.os.Looper.loop(Looper.java:160)
    at android.app.ActivityThread.main(ActivityThread.java:6728)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

 

 

 

 

 

Could someone please help fix/understand this error as I am receiving this error only on the Automotive_Virtual_Device. Let me know if any further information are required.

 

Thank you in advance!

Reply
0 Replies

Suggested posts

Staff
Let's introduce ourselves!

Hey there you,   Yeah, you! ๐Ÿ˜   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and getโ€ฆ

Staff
ModeratorStaff / Moderator/ 3 years ago  in Social & Random

Type a product name