i google about local aar,every one say it can work,but it don't work at android studio 1.1.0.
i try to use :
compile fileTree(dir: 'libs', include: ['*.aar'])
but it tip:
Warning:Project app: Only Jar-type local dependencies are supported. Cannot handle: /Users/kycq/AndroidStudioProjects/QingTaJiao/app/libs/KycqBasic-release.aar
how should i do to use local aar? if i should use:
compile 'com.example.library:library:1.0.0@aar'
how to do this?
To add a dependency to your project, specify a dependency configuration such as implementation in the dependencies block of your module's build.gradle file.
I was getting the same errors.
This was the only thing that helped me:
dependencies { compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar') } repositories{ flatDir{ dirs 'libs' } }
Reference: Adding local .aar files to Gradle build using "flatDirs" is not working
In my case a have to distribute an aar. When i import the aar in another project this error appears. I solve this problem distributing the aar with a maven dependency structure (pom, md5, etc...)
publishing { publications { maven(MavenPublication) { groupId "<GROUP_ID>" artifactId "<ARTIFACT_ID>" version <VERSION> artifact "$buildDir/outputs/aar/<AAR_FILE>" pom.withXml { def dependenciesNode = asNode().appendNode("dependencies") configurations.compile.allDependencies.each { dependency -> def dependencyNode = dependenciesNode.appendNode("dependency") dependencyNode.appendNode("groupId", dependency.group) dependencyNode.appendNode("artifactId", dependency.name) dependencyNode.appendNode("version", dependency.version) } } } } repositories { maven { url "$buildDir/repo" } } }
On the android application i need to add the local maven repository:
allprojects { repositories { jcenter() maven { url "<LOCAL_REPO>" } } }
And add the dependency:
compile("<GROUP_ID>:<ARTIFACT_ID>:<VERSION>@aar") { transitive = true }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With