Publish an Android library to Maven with AAR and sources JAR

Current answer With Android Gradle Plugin 7.1 it is now very simple to do this without needing any complicated scripts. AGP now also handles creating source and javadocs jar. You don’t need any separate scripts, just write everything into your build.gradle file of your module: plugins { … id ‘maven-publish’ } android { … publishing … Read more