This project hasn't been updated since 2016, so it cannot be built with the latest version of gradle. There are some shenanigans that must be done. I am a very small programmer fish in this big scary ocean, but after a great deal of trial and error, I think I've found a way to make the project build properly on Windows.
Note: you'll want to just use "gradlew" in the command line instead of "./gradlew" in windows.
There are two things you need to do: Set the SDK to version 23, and set the buildtools to version 23.0.2.
-
Install gradle on your computer, if you haven't already. (I am 60% sure this step was necessary- maybe it wasn't).
-
In android studio, go to Tools -> SDK Manager. Check the box for Android 6.0(Marshmallow) and click "Ok". Now, if you were to run the gradlew command now, you would get an error like "cannot find BuildTools 23.0.2" or something like that. This is because the default Android Studio installation of SDK version 23 is 23.0.3, and the project wants 23.0.2. So we're going to fix that.
-
On the command line, navigate to C:\Users[username]\AppData\Local\Android\Sdk\tools\bin. This is where the sdkmanager lives. It can install the build tools we need. Type 'sdkmanager "build-tools;23.0.2"' and hit enter. Make sure there's no whitespace anywhere within the quotes. Here's more info on sdkmanager: https://developer.android.com/studio/command-line/sdkmanager
-
Go back to the location of the project. Run "gradlew", not "gradlew assemble". When I ran gradlew assemble it broke halfway through for reasons I couldn't decipher, but running "gradlew" will give you the .aar file in the location described in the setup.
Hopefully this will help! Godspeed!
PS To add the .aar file to your android project:
Move the .aar file into your android project directory (it can go anywhere)
- File -> New -> New Module -> Import .JAR/.AAR Package, click "Next"
- In "File Name:" put the location of the .aar file, click "Finish
- Go to File -> Project Structure -> Dependencies, click on "app" in the Module section
- Click the "+" sign above the dependencies and select "Module Dependency"
- Select the module you created
- Rebuild your project
PPS I'll just leave some notes on things I've had to fiddle with to make it work so far-
- You need to add a dependency for "retrofit" in your project. Add the line "implementation ('com.squareup.retrofit:retrofit:1.9.0')" to your app build.gradle dependencies and rebuild.
- You can see all of kaaes's source code if you look in that repository you cloned. It's super useful.
Edit
I've attached my .aar to my original post.
spotify-web-api-android-0.4.1.zip
This project hasn't been updated since 2016, so it cannot be built with the latest version of gradle. There are some shenanigans that must be done. I am a very small programmer fish in this big scary ocean, but after a great deal of trial and error, I think I've found a way to make the project build properly on Windows.
Note: you'll want to just use "gradlew" in the command line instead of "./gradlew" in windows.
There are two things you need to do: Set the SDK to version 23, and set the buildtools to version 23.0.2.
Install gradle on your computer, if you haven't already. (I am 60% sure this step was necessary- maybe it wasn't).
In android studio, go to Tools -> SDK Manager. Check the box for Android 6.0(Marshmallow) and click "Ok". Now, if you were to run the gradlew command now, you would get an error like "cannot find BuildTools 23.0.2" or something like that. This is because the default Android Studio installation of SDK version 23 is 23.0.3, and the project wants 23.0.2. So we're going to fix that.
On the command line, navigate to C:\Users[username]\AppData\Local\Android\Sdk\tools\bin. This is where the sdkmanager lives. It can install the build tools we need. Type 'sdkmanager "build-tools;23.0.2"' and hit enter. Make sure there's no whitespace anywhere within the quotes. Here's more info on sdkmanager: https://developer.android.com/studio/command-line/sdkmanager
Go back to the location of the project. Run "gradlew", not "gradlew assemble". When I ran gradlew assemble it broke halfway through for reasons I couldn't decipher, but running "gradlew" will give you the .aar file in the location described in the setup.
Hopefully this will help! Godspeed!
PS To add the .aar file to your android project:
Move the .aar file into your android project directory (it can go anywhere)
PPS I'll just leave some notes on things I've had to fiddle with to make it work so far-
Edit
I've attached my .aar to my original post.
spotify-web-api-android-0.4.1.zip