There is a library written by me, it lies on gitlab. And there is my main project, how to connect this library to the project?

    2 answers 2

    More options:

    1. Publish to local Maven using a plugin: https://github.com/dcendents/android-maven-gradle-plugin
      The easiest option if you work alone.

    2. Raise your own Maven repo with Nexus: https://www.sonatype.com/nexus-repository-sonatype
      Publish later in it whatever your heart desires, will be available to everyone who has access to the repository address.

    In both cases, after publishing, you register the repository to the project and library as a normal dependency.

      Options:

      1. Clone the library on your machine. Import it as a module into a project via Android Studio (in the city everything is written by itself).
      2. If you want to dynamically connect via a remote repository, then you need to publish the library, as described here:

      https://code.tutsplus.com/tutorials/creating-and-publishing-an-android-library--cms-24582

      And then you simply write the dependency by specifying compile 'group:artifact:version' .

      • Can you connect via a remote repository without publishing the library? - VladislawFox
      • How do you pull up a library from a remote repository without registering a library there? This refers to the repository of not the gitlab, but for example mavenCentral, jcenter, bintray, etc. - Vladimir Parfenov