Compile an Android library that contains a third-party .aar dependency

465 views Asked by At

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.

0

There are 0 answers