0

Requirement:

I have two library projects example, projectCoreModules, and projectCoreValidation.

Project A referring these two aar library projects and it's working fine.

current requirement, new project B also wants to refer this two aar library.

So, I created a separate repo for coreModules and CoreValidation projects in Azure DevOps.

Whenever PR is raised, the pipeline build will be triggered and it will publish the aar files.

enter image description here

I know, we can refer to the azure artifact feeds, in our android apps using the below code in Gradle.

 api (group: 'Tst', name: 'TestingPackage', version: '3.1.0', ext: 'jar')

Same like this way, Is it possible to refer to the published aar files to projectA and projectB. So that I can reduce the code.

Even though I have tried with the universal package, through the build pipeline I can able to publish as a universal package. But, I was unable to refer those published to ProjectA and ProjectB. so that Gradle build of these two projects gets to succeed.

Kalai Selvi
  • 157
  • 11
  • Have you checked these similar issues? [Can I publish AAR file is included another AAR file in /libs folder?](https://stackoverflow.com/questions/54032608/can-i-publish-aar-file-is-included-another-aar-file-in-libs-folder), [Android Library AAR depending on another library](https://stackoverflow.com/questions/23042803/android-library-aar-depending-on-another-library) and [Is it possible to share library projects between projects when using Android Studio and gradle?](https://stackoverflow.com/questions/18069080/is-it-possible-to-share-library-projects-between-projects-when-using-android-stu) – Ecstasy Apr 08 '22 at 04:39
  • @DeepDave-MT, actually my common library files in the azure feed, from which i need to refer it in the both apps projectA and projectB – Kalai Selvi Apr 08 '22 at 07:05

1 Answers1

0

We are using similar in our project. However instead of using ext: "jar", we don't use any ext and it is working. Try this:

api (group: 'Tst', name: 'TestingPackage', version: '3.1.0')

I suppose you have already setup your repository source at the project level build.gradle file. We have setup like so

allprojects {
  repositories {
    google()
    mavenCentral()

    maven {
        url project.ARTIFACT_URL
        name project.FEED_NAME
        credentials {
            username project.PROJECT_NAME_ON_AZURE
            password System.getenv("SYSTEM_ACCESSTOKEN") != null ? System.getenv("SYSTEM_ACCESSTOKEN") : project.MAVEN_ACCESS_TOKEN
        }
    }
}

}

saintjab
  • 1,626
  • 20
  • 31