Search code examples
gradlegradlew

Gradle build failing : Task 'jar' not found in root project 'spotify-web-api-android'


I am trying to use the 'spotify-web-api-android' library by compiling and building a jar. Instructions to generate the jar have been provided, but are failing for me.

  • What I want : Build the jar file successfully
  • What is the problem - I am not familiar to Gradle and am getting the error : Task 'jar' not found in root project 'spotify-web-api-android'.
  • Steps followed:

    • Downloaded spotify (see screenshot) enter image description here
    • Changed directory to the downloaded git

    • Executed command : ./gradlew jar enter image description here

Link to api and instructions : https://github.com/kaaes/spotify-web-api-android/blob/master/README.md

Instructions to generate jar:

  1. Clone the repository: git clone https://github.com/kaaes/spotify-web-api-android.git
  2. Build: ./gradlew jar
  3. Grab the jar and put it in your project. It can be found in build/libs/spotify-web-api-android-0.1.0.jar

Solution

  • I think those build instructions are out of date.

    Try the ./gradlew assemble instructions instead, using the aar dependency