Create & Publish Android Library (.aar) to Maven Jitpack Repo | Android Studio

preview_player
Показать описание
Create & Publish Android Library (.aar) to Maven Jitpack Repo | Android Studio

#android #maven #github

#jitpack #android #androidstudio #maven #aar #github #apple #programming #java #kotlin #mac #macos #m2pro #sonoma

*Long Story Short*
Step 1: Create an Android Project in which we will be creating our new Android Module/ Library. Build and run the Android Project on an Android Device /Emulator.

Step 2: Create an Android Library and add it as dependency to our Android project. Implement some logic to this library. To test this library is working, import it in Android project and try to call it's public method.

Step 5: Before publishing to Maven Repo directly, lets first try to publish the library to localMaven using the gradle command:
./gradlew publishMavenPublicationToMavenLocal

Step 6: Create & publish a new release on the Github using the AAR File which we have committed earlier. After creating this release, go back to Jitpack dashboard, check for the latest releases. Jitpack will automatically starts building the library, once done successfully you'll see the icon in green on Jitpack. You can also check the log dumped by Jitpack while building and publishing the library.

-------------------------------------

*Link to Files used*

-------------------------------------

*Credits*
- Apple: macOS & Video Made with Final Cut Pro

-------------------------------------
*Commands Used*
Gradle:
- publish module to local maven: ./gradlew publishMavenPublicationToMavenLocal
- list all available tasks: ./gradlew tasks

Git:
- initialize git: git init
- add remote url: git remote add origin "REPO_URL"
- check remote url: git remote -v
- add all the files: git add .
- push to git: git push (--force)

-------------------------------------

For more you can also checkout my medium post:

-------------------------------------

#imchampagnepapi

Thanks ❤️ for checking out this video, hope this helps.
Рекомендации по теме
Комментарии
Автор

i have a question if my arr file have include other dependency like retrofit if i publish that no need to include retrofit to project that use my library right?

visalny
Автор

Thankyou so much, It helped..I learned the basics of building android library.

harikrishnanjayachandran
Автор

hello why when im adding module build it says always kotlin unresolve refrence. tnx

Emperorkai-dmzx
Автор

How can I do this using the Kotlin language ? i tested this tutorial, it's working very fine, but in my case the class file is not readable :X

Saidonly
Автор

Nice video, how about publishing Flutter .aar module to maven jitpack? is it the same?

alphalimit
Автор

have you pushed the code after the gradle code changes

nitesharu