Android Studio adds two ways to add AAR to it

1. The first method: a deep point of application.

android{
    repositories {
        flatDir {
            dirs 'libs'
        }
    }
}
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation (name: 'barcode_scanner_library_v2.3.2.0', ext: 'aar')
}

2. The second method:

android{
   // не нужно писать
   /* repositories {
        flatDir {
            dirs 'libs'
        }
    }*/
}
dependencies {
      Воля 
     implementation fileTree(dir: 'libs', include: ['*.jar'])
           Изменить на
     implementation fileTree(dir: 'libs', include: ['*.jar','*.aar'])
}

  

Reprinted at: https://www.cnblogs.com/tc310/p/10024441.html

Leave a Comment