Hi, I have troubles with setting the dependency on...
# touchlab-tools
p
Hi, I have troubles with setting the dependency on my android project using KMMBridge. I am using private GitHub repository and successfully published the packages. Now, I am trying to get the dependency work, but after adding this:
Copy code
repositories {
    maven {
        name = "shared-kmp"
        url = uri("<https://maven.pkg.github.com/tiltapp/shared-kmp>")
        credentials {
            username = project.property("GITHUB_PACKAGES_USERNAME") as String
            password = project.property("GITHUB_PACKAGES_PASSWORD") as String
        }
    }
}
to my
build.gradle.kts(:app)
, all other dependencies are trying to use github maven to download. My
settings.gradle
in the thread 🧵
solved 1
Settings.gradle.kts:
Copy code
pluginManagement {
    repositories {
        google()
        gradlePluginPortal()
        mavenCentral()
    }
}

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("<https://jitpack.io>") }
    }
}
rootProject.name = "Retro"
include(":app")
I am using gradle 8.2 and AGP 8.2.0 Kotlin 1.9.20
one of the libraries error:
Copy code
Required by:
    project :app
Cause 33: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.google.accompanist:accompanist-swiperefresh:0.32.0.
Searched in the following locations:
  - <https://maven.pkg.github.com/tiltapp/shared-kmp/com/google/accompanist/accompanist-swiperefresh/0.32.0/accompanist-swiperefresh-0.32.0.pom>
j
Sounds like you're now only specifiying the repo that hosts the KMP artifact. You can (should) also specify the others, like
mavenCentral()
and
google()
. At least, the error suggests that (seeing the locations it searched being just the shared-kmp host)
p
yes, I get that. I posted the
settings.gradle.kts
for the reference. If I do not have this custom repo added, everythings works as expected.
j
Aye. Doesn't the repositories block inside build.gradle overwrite the repos configured in settings.gradle, though? I seem to recall there's even a setting you can set to make gradle throw an error when that happens
p
cool. I delete the
dependencyResolutionManagement
from settings.gradle and updated root build.gradle to include them. Now it works. Thanks
👍 1