Android Studio cannot find AAR packages

11,289

Looks like you could do this How to manually include external aar package using new Gradle Android Build System

If you have them in your lib folder

repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    compile(name:'UpPlatformSdk', ext:'aar')
}
Share:
11,289
Marcus Gabilheri
Author by

Marcus Gabilheri

Android Engineer @ Tinder

Updated on June 13, 2022

Comments

  • Marcus Gabilheri
    Marcus Gabilheri almost 2 years

    I am having a problem with Android Studio recognizing classes inside an @aar library imported locally.

    So... I've made a library and exported is an aar file. Inside android studio I selected Import Module and them Import .JAR or .AAR Package.

    The project compiles and works with the classes inside the aar file but Android studio can not find the classes or offer any auto completion of so all.

    Here is a few of screenshots:

    screenshot1 enter image description here enter image description here

    The same problem also happens with other @aar libraries imported the same way: enter image description here

    Any suggestions?

    Edit:

    build.gradle:

    ...
    dependencies {
       compile fileTree(dir: 'libs', include: ['*.jar'])
       compile project(':UpPlatformSdk')
       compile project(':simpleorm')
       ... // more libraries here
    }
    

    settings.gradle:

    include ':app', ':UpPlatformSdk', ':wear', ':simpleorm'