Skip to main content
PLEASE READ THIS BEFORE REJECTING - Community is removing SO documentation links according to guidelines in https://meta.stackoverflow.com/questions/356294/removing-documentation-reputation-archive-and-links?cb=1
Source Link
Graham
  • 7.9k
  • 20
  • 67
  • 92

You can different types of dependenciestypes of dependencies in a project:

dependencies { // Dependency on the "mylibrary" module from this project compile project(":mylibrary") // Remote binary dependency compile 'com.android.support:appcompat-v7:24.1.0' // Local binary dependency compile fileTree(dir: 'libs', include: ['*.jar']) } 

Also you can use aar filesaar files defining a flatDir:

repositories { flatDir { dirs 'libs' } } 

then adding the dependency:

dependencies { compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar') } 

To create a library module just create a module in Android Studio and use in the module/build.gradle

apply plugin: 'com.android.library' 

Then you can use it as:

  • a project (compile project(":mylibrary"))
  • you can build the aar file and use it as aar file
  • upload the library in a maven repository and use it as remote dependency

You can different types of dependencies in a project:

dependencies { // Dependency on the "mylibrary" module from this project compile project(":mylibrary") // Remote binary dependency compile 'com.android.support:appcompat-v7:24.1.0' // Local binary dependency compile fileTree(dir: 'libs', include: ['*.jar']) } 

Also you can use aar files defining a flatDir:

repositories { flatDir { dirs 'libs' } } 

then adding the dependency:

dependencies { compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar') } 

To create a library module just create a module in Android Studio and use in the module/build.gradle

apply plugin: 'com.android.library' 

Then you can use it as:

  • a project (compile project(":mylibrary"))
  • you can build the aar file and use it as aar file
  • upload the library in a maven repository and use it as remote dependency

You can different types of dependencies in a project:

dependencies { // Dependency on the "mylibrary" module from this project compile project(":mylibrary") // Remote binary dependency compile 'com.android.support:appcompat-v7:24.1.0' // Local binary dependency compile fileTree(dir: 'libs', include: ['*.jar']) } 

Also you can use aar files defining a flatDir:

repositories { flatDir { dirs 'libs' } } 

then adding the dependency:

dependencies { compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar') } 

To create a library module just create a module in Android Studio and use in the module/build.gradle

apply plugin: 'com.android.library' 

Then you can use it as:

  • a project (compile project(":mylibrary"))
  • you can build the aar file and use it as aar file
  • upload the library in a maven repository and use it as remote dependency
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

You can different types of dependenciestypes of dependencies in a project:

dependencies { // Dependency on the "mylibrary" module from this project compile project(":mylibrary") // Remote binary dependency compile 'com.android.support:appcompat-v7:24.1.0' // Local binary dependency compile fileTree(dir: 'libs', include: ['*.jar']) } 

Also you can use aar filesaar files defining a flatDir:

repositories { flatDir { dirs 'libs' } } 

then adding the dependency:

dependencies { compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar') } 

To create a library module just create a module in Android Studio and use in the module/build.gradle

apply plugin: 'com.android.library' 

Then you can use it as:

  • a project (compile project(":mylibrary"))
  • you can build the aar file and use it as aar file
  • upload the library in a maven repository and use it as remote dependency

You can different types of dependencies in a project:

dependencies { // Dependency on the "mylibrary" module from this project compile project(":mylibrary") // Remote binary dependency compile 'com.android.support:appcompat-v7:24.1.0' // Local binary dependency compile fileTree(dir: 'libs', include: ['*.jar']) } 

Also you can use aar files defining a flatDir:

repositories { flatDir { dirs 'libs' } } 

then adding the dependency:

dependencies { compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar') } 

To create a library module just create a module in Android Studio and use in the module/build.gradle

apply plugin: 'com.android.library' 

Then you can use it as:

  • a project (compile project(":mylibrary"))
  • you can build the aar file and use it as aar file
  • upload the library in a maven repository and use it as remote dependency

You can different types of dependencies in a project:

dependencies { // Dependency on the "mylibrary" module from this project compile project(":mylibrary") // Remote binary dependency compile 'com.android.support:appcompat-v7:24.1.0' // Local binary dependency compile fileTree(dir: 'libs', include: ['*.jar']) } 

Also you can use aar files defining a flatDir:

repositories { flatDir { dirs 'libs' } } 

then adding the dependency:

dependencies { compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar') } 

To create a library module just create a module in Android Studio and use in the module/build.gradle

apply plugin: 'com.android.library' 

Then you can use it as:

  • a project (compile project(":mylibrary"))
  • you can build the aar file and use it as aar file
  • upload the library in a maven repository and use it as remote dependency
edited body
Source Link
Gabriele Mariotti
  • 370.1k
  • 114
  • 1k
  • 935

You can different types of dependencies in a project:

dependencies { // Dependency on the "mylibrary" module from this project compile project(":mylibrary") // Remote binary dependency compile 'com.android.support:appcompat-v7:24.1.0' // Local binary dependency compile fileTree(dir: 'libs', include: ['*.jar']) } 

Also you can use aar files defining a flatDir:

repositories { flatDir { dirs 'libs' } } 

then adding the dependency:

dependencies { compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar') } 

To create a library module just create a module in Android Studio and use in the module/build.gradle

apply plugin: 'com.android.library' 

Then you can use it as:

  • a project (compile project(":mylibrary"))
  • you can build the aar file and use it as aar file
  • upload the library in a maven repository and use it adas remote dependency

You can different types of dependencies in a project:

dependencies { // Dependency on the "mylibrary" module from this project compile project(":mylibrary") // Remote binary dependency compile 'com.android.support:appcompat-v7:24.1.0' // Local binary dependency compile fileTree(dir: 'libs', include: ['*.jar']) } 

Also you can use aar files defining a flatDir:

repositories { flatDir { dirs 'libs' } } 

then adding the dependency:

dependencies { compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar') } 

To create a library module just create a module in Android Studio and use in the module/build.gradle

apply plugin: 'com.android.library' 

Then you can use it as:

  • a project (compile project(":mylibrary"))
  • you can build the aar file and use it as aar file
  • upload the library in a maven repository and use it ad remote dependency

You can different types of dependencies in a project:

dependencies { // Dependency on the "mylibrary" module from this project compile project(":mylibrary") // Remote binary dependency compile 'com.android.support:appcompat-v7:24.1.0' // Local binary dependency compile fileTree(dir: 'libs', include: ['*.jar']) } 

Also you can use aar files defining a flatDir:

repositories { flatDir { dirs 'libs' } } 

then adding the dependency:

dependencies { compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar') } 

To create a library module just create a module in Android Studio and use in the module/build.gradle

apply plugin: 'com.android.library' 

Then you can use it as:

  • a project (compile project(":mylibrary"))
  • you can build the aar file and use it as aar file
  • upload the library in a maven repository and use it as remote dependency
Source Link
Gabriele Mariotti
  • 370.1k
  • 114
  • 1k
  • 935
Loading