Adding Android aar dependency via gradle not working

Answered

Hi there. I have an Android project with a few dependencies, three of them *aar.

Like this, for example:

compile 'se.emilsjolander:stickylistheaders:2.7.0@aar'

However, when i reimport them, the dependency in the project gets really weird. I get "broken path" warning when i go into dependencies, and the path is something in "exploded-aar", for example:

/projects/android/app/build/intermediates/exploded-aar/com.android.support/support-v4/22.0.0/res

I can remove the dependency, and re-add it, but it still gets the same path. 

 

I am not sure why this is. When i build the project command-line with gradle all works fine, as does it if i build from within Intellij. Regardless of how i build, nothing appears in the "exploded-aar" directory.

 

Pointers much appreciated.

1
4 comments

Please report at https://youtrack.jetbrains.com/issues/IDEA with the sample project to reproduce attached.

0

Hey Serge, thanks for quick reply.

 

Hmm, thats interesting. When i created a new, empty project to include in my ticket, the dependency is created as expected when i add it! But in my "old" project, it does not. 

 

Could you venture a guess as to what i could do/investigate with my old project to determine why that dependency is created differently?

 

 

0

Not sure, try deleting .idea directory and reimport from Gradle.

0

Thanks. It worked when i remove the idea dir and re-create it. Strange though.

0

Please sign in to leave a comment.