Samuel Stafford
Samuel Stafford

Reputation: 21

Android Studio Spotify Error: Failed to resolve: com.spotify.sdk-player-24-noconnect-2.20b::

I believe the project has been set up exactly as the documentation outlines, but I still am getting this error.

Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly.
Error: Failed to resolve: com.spotify-player-24-noconnect-2.20b: Open File

Any suggestions to correct this?

enter image description here

Upvotes: 2

Views: 1287

Answers (1)

Craig Graham
Craig Graham

Reputation: 1191

I had this same issue. The code in the tutorial is correct, and that compile line is indeed

compile 'com.spotify.sdk:spotify-player-24-noconnect-2.20b@aar'

with a dash between player and 24, contrary to Charlie's answer. The problem I had was earlier in the process- the instructions for installing the auth and player libraries are different. For auth you copy the whole auth library into app/libs whereas for player you just copy the .aar file itself from within the player folder. It's easy to not notice that and just copy both folders.

Given this might be found after the keyword "compile" ceases to be valid, the lines should actually now be:

// This library handles authentication and authorization
api 'com.spotify.android:auth:1.0.0-alpha'

// This library handles music playback
api 'com.spotify.sdk:spotify-player-24-noconnect-2.20b@aar'

Upvotes: 1

Related Questions