1

I am creating my first, privately hosted Android library on jitpack.

Issue: My hosted library contains a third-party .aar dependency (Spotify player SDK). The third-party has not yet hosted their library, so I'm stuck with referencing that third-party dependency from my library project via the following: repositories { jcenter() flatDir { dirs 'libs' } } ... dependencies { compile 'com.spotify.sdk:spotify-player-24-noconnect-2.20b@aar' }

Of course when I try to host my library on jitpack and compile my library dependency in a sample project, I receive the following error: Error:Could not resolve all files for configuration ':app:debugCompileClasspath'.

Could not resolve com.github.example:my-private-library:0.9.0. Required by: project :app Could not resolve com.github.vertigomedia:my-private-library:0.9.0. Could not parse POM https://jitpack.io/com/github/example/my-private-library/0.9.0/my-private-library-0.9.0.pom Unable to resolve version for dependency 'com.spotify.sdk:spotify-player-24-noconnect-2.20b:aar'

The 'com.spotify.sdk:spotify-player-24-noconnect-2.20b:aar' library cannot be resolved because it's not remotely hosted anywhere.

Does anyone have any suggestions on how to resolve this? Do I need to privately host the Spotify player library .aar myself? I'd prefer not to have to do that for licensing reasons. Can I somehow exclude the .aar from my .pom file and have the client sample app manually include the Spotify player .aar dependency in its build.gradle file? Any thoughts on this would be greatly appreciated.

Ryan
  • 3,414
  • 2
  • 27
  • 34
  • 1
    "Do I need to privately host the Spotify player library .aar myself?" -- I would be rather surprised if you are allowed to do that from a licensing standpoint. "Can I somehow exclude the .aar from my .pom file and have the client sample app manually include the Spotify player .aar dependency in its build.gradle file?" -- you could try using `provided` rather than `compile` in your library, and then require apps using your library to `compile` in Spotify's SDK. – CommonsWare Sep 04 '17 at 17:56
  • Agreed on the licensing bit. I'd rather not mess with that. Using `provided` did the trick for me. This places a little more work than I'd like for the client app, but I think it's my only option. Thank you for your suggestion! I was not familiar with `provided` until now. – Ryan Sep 04 '17 at 18:18

0 Answers0