1

I was using this library - https://github.com/shamanland/fonticon - as a dependency of an application that I'm developing on Android Studio 0.5.8. I found out that custom maven repo is no longer reachable, so I decided to compile it to aar, and put it in my android project as a local library.

I simply ran 'gradle assembleRelease' on this project, then copied the build/libs/libs.aar file to my project in libs directory. As explained in this blog entry - http://geekgarage.labasland.net/local-aar-android-library/ - I added the reference to the file, so build.gradle file looks like the following.

dependencies {
    compile files('libs/volley.jar')
    compile files('libs/libGoogleAnalyticsServices.jar')
    compile files('libs/fonticon.aar')
    compile 'com.android.support:support-v4:19.1.0+'
    compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
    compile 'com.github.chrisbanes.actionbarpulltorefresh:library:+'
    compile 'com.android.support:appcompat-v7:19.+'
}

I'm still getting errors as if the library isn't there. What is strange to me is that even if I deliberately mis-reference that file (e.g. changing the file name to fonticon.jar) gradle does not complain at all. So I'm wondering if that file is being used at all. There is no feedback from gradle that this file is successfully loaded or not.

Is there anything I'm missing? How can I ensure that aar file is referenced and loaded successfully?

CTheDark
  • 2,507
  • 3
  • 18
  • 18
  • Maybe try to run the task with `-d` (debug) flag turned on and investigate the output. – Opal May 28 '14 at 07:35
  • @ScottBarta I don't believe it's a duplicate because that question was for pre-0.5.0 when loading an aar involved a hack. The method of adding an aar differs in the version I specified in this question. I believe it's now officially supported. – CTheDark May 28 '14 at 17:58
  • @ScottBarta actually... you are right. I used the answer in the question you linked and it worked contrary to the statement in that blog entry that aar is directly supported after 0.5.0. – CTheDark May 28 '14 at 18:18
  • I think you were referencing this bug: https://code.google.com/p/android/issues/detail?id=55863 which was originally targeted at 0.5.0; at the time, we were using that version number as a proxy for "beta release", but that's no longer true, and the fix for this hasn't been implemented yet. – Scott Barta May 28 '14 at 18:22

1 Answers1

0

Contrary to what the blog entry told me. Simply adding the aar in the dependencies did not work. What worked for me even in Android Studio 0.5.0+ is the pre-0.5.0 method described in various blogs and this answer: Adding local .aar files to my gradle build

Community
  • 1
  • 1
CTheDark
  • 2,507
  • 3
  • 18
  • 18