Monday, 3 April 2023

How can I use repositories in my android module's build.gradle not in Top-level(Project's) build.gradle?

I have a library module. it is using a library from

allprojects {
    repositories {
maven {
       url = uri("https://jitpack.io/")
   }
}

sync only successful if i add jitpack dependency in project level build.gradle. now, i dont want to force my library users to add jitpack dependency in their project level build.gradle. so, i am trying to add repositories in library module itself.

i tried below code in my library.

plugins {
    id("com.android.library")
}

repositories {
        google()
maven {
       url = uri("https://jitpack.io/")
   }
}

android {
   // ...
}

dependencies {
// from jitpack
implementation("https://github.com/a914-gowtham/compose-ratingbar")
  // ...
}


from How can I use repositories in my android module's build.gradle not in Top-level(Project's) build.gradle?

No comments:

Post a Comment