0

I created an Kotlin library that uses Apollo as its GraphQL client. I am trying to publish it to Jitpack. I run ./gradlew install command but the build fails:

Could not publish configuration 'archives'
Cannot publish artifact 'metadata.json' (.../sample/build/generated/metadata/apollo/debugAndroidTest/service/metadata.json)) as it does not exist.

Let me know if more info is needed. Thanks!

Valentin
  • 43
  • 4

1 Answers1

1

Hope this can help other developers.

Jitpack documentation is not updated. Be sure you are not using:

plugins {
    id 'com.android.library'
    id 'kotlin-android'
    id 'com.apollographql.apollo'
    id 'kotlinx-serialization'
    id 'com.github.dcendents.android-maven' <------
}

Replace com.github.dcendents.android-maven with maven-publish. com.github.dcendents.android-maven is marked as deprecated. Then you can just add your configurations to public to maven in your library build gradle.

    afterEvaluate {
        publishing {
            publications {
                // Creates a Maven publication called "release".
                release(MavenPublication) {
                    // Applies the component for the release build variant.
                    from components.release
    
                    // You can then customize attributes of the publication as shown below.
                    groupId = 'com.test.sdk.library'
                    artifactId = 'test'
                    version = 0.0.1 //(whatever version you want)
                }
            }
        }
    }
Valentin
  • 43
  • 4