I have created a Kotlin multiplatform module which I am now trying to add as a dependency to my Android project. I have published the module to GitHub packages. When I try to sync the Android project I get the following error:
Failed to resolve: com.example:package:version
Where com.example is the group, package is the artifact id and version is the version.
The dependency looks like this in the build.gradle for the module in my project which depends on it
repositories {
mavenCentral()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/[account-name]/[repository-name]")
credentials(PasswordCredentials)
}
}
dependencies {
implementation project(':expo-modules-core')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
implementation "com.example:package:version"
}
I have tried to find the cause of this problem but I am not familiar enough with Android Studio or Gradle to get any useful diagnostic information.
I believe that authentication with GitHub packages is working correctly since if I try setting an incorrect value for the access token I start getting authentication errors.
I would be very grateful if someone could help me to identify the source of this problem.