Android Studio添加aar依赖的两种方式

  • 第一种:
android{
    repositories {
        flatDir {
            dirs 'libs'
        }
    }
}
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation (name: 'barcode_scanner_library_v2.3.2.0', ext: 'aar')
}
  • 第二种:
android{
   //不用写
   /* repositories {
        flatDir {
            dirs 'libs'
        }
    }*/
}
dependencies {
     将
     implementation fileTree(dir: 'libs', include: ['*.jar'])
     改为
     implementation fileTree(dir: 'libs', include: ['*.jar','*.aar'])
}

**转载出处:**https://www.cnblogs.com/jooy/p/9489527.html

你可能感兴趣的:(app开发小兴趣,Android)