Android Library Gradle release JAR

While I haven’t tried uploading the artifacts with a deployment to Sonatype (or even a local repo), here’s what I managed to come up with a few weeks ago when trying to tackle the same problem. android.libraryVariants.all { variant -> def name = variant.buildType.name if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) { return; // Skip debug builds. } def task … Read more

Adding local .aar files to my gradle build

You put your flatDir block in the wrong repostories block. The repositories block inside buildscript tells Gradle where to find the Android-Gradle plugin, but not the rest of the dependencies. You need to have another top-level repositories block like this: repositories { mavenCentral() flatDir { dirs ‘aars’ } } I tested this and it works … Read more

Gradle finished with non-zero exit value 1 (ic_launcher.png: error: Duplicate file)

According to Xavier Durochet’s explanation on G+, it’s due to one of the libraries you use having it’s own ic_launcher.png — which they of course should not (more on that at the bottom). Chances are the two icons mentioned in the log are different: one is yours and another one is most likely the generic … Read more

How to convert AAR to JAR

The AAR file consists of a JAR file and some resource files (it is basically a standard zip file with a custom file extension). Here are the steps to convert: Extract the AAR file using standard zip extract (rename it to *.zip to make it easier) Find the classes.jar file in the extracted files Rename … Read more

Error building Android library: Direct local .aar file dependencies are not supported

I recently encountered the same issue, the fix was to remove the library from libs/ and import it using File -> New -> New Module -> Import .JAR/.AAR Package, then referencing it in the library module build.gradle file: dependencies { implementation project(“:imported_aar_module”) } If you are on a newer Android Studio version (4.0.0+), this option … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)