Publish Android library with Gradle 8 causes a ERROR: No build artifacts found

234 Views Asked by At

I struggle with publishing an Android library using Gradle 8.x. I always run into ERROR: No build artifacts found

Here is my jipack.io issue https://github.com/jitpack/jitpack.io/issues/5562 and this is a log file https://jitpack.io/com/github/hannesa2/paho.mqtt.android/Giraffe-4.0-ge964d9d-5/build.log

1

There are 1 best solutions below

0
On BEST ANSWER

After days I found the solution I changed the working Gradle 7.x publish part

project.afterEvaluate {
    publishing {
        publications {
            release(MavenPublication) {
                from components.release
                artifact androidSourcesJar
            }
        }
    }
}

with Gradle 8 into this

publishing {
    publications {
        release(MavenPublication) {
            afterEvaluate {
                from components.release
            }
        }
    }
}

and now it works