Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio cannot find AAR packages

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:

screenshot1enter image description hereenter 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'
like image 281
Marcus Gabilheri Avatar asked Sep 29 '22 12:09

Marcus Gabilheri


1 Answers

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')
}
like image 189
puj Avatar answered Oct 06 '22 20:10

puj