Search code examples
gradlepublishingbintraykotlin-multiplatform

Could not get unknown property 'publishableFiles'


Am getting the following error while trying publish to bintray.

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':bintrayUpload'.
> Could not get unknown property 'publishableFiles' for object of type org.gradle.api.publish.maven.internal.publication.DefaultMavenPublication.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':bintrayPublish'.
> Could not publish 'messai/maven/kyuga/0.0.6': HTTP/1.1 404 Not Found [message:Version '0.0.6' was not found]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 2s

My project is a kotlin multi-platform one and following is the publish settings in gradle:

publishing {
    repositories {
        maven {
            url  = project.projectBintrayRepo
        }
    }

    publications {
        mavenProject(MavenPublication) {
            groupId project.groupId
            artifactId project.projectBintrayArtifactName
            version project.kyugaVersion
            withPom(pom)
        }
    }
}

Please help


Solution

    1. Something in your project is trying to get a publishableFiles property from a MavenPublication. As the error indicates, no such property exists.
    2. Looks like you're trying to publish to a repository that does not exist, hence the 404 Not Found. You need to publish to a repository that exists.