1. Import project new->new module in module form
2. Change the module to library builder.gradle
apply plugin: 'com.android.application' change to apply plugin: 'com.android.library'
defaultConfig { applicationId "com.example.administrator.m3demo" remove this line
3. Compile, find the generated aar in builder->outputs->aar
4. Remove the module just introduced and put the generated aar in libs
dependencies { ..... compile (name:'m3demo-release',ext:'aar') } //repositories{ // flatDir{ // dirs 'libs' // } //}