Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find method uploadArchives() for arguments in build.gradle

I updated the gradle version to the 7.0.4 (com.android.tools.build:gradle:7.0.4)

And now in some of my modules I am solving the problem with maven.

So i replace apply plugin: 'maven' on apply plugin: 'maven-publish'

But I don't understand how to rewrite this section of code correctly:

uploadArchives {
    repositories {
        mavenDeployer {
            repository(url: uri("${rootProject.projectDir}/maven-repo"))
        }
    }
}

uploadArchives.dependsOn sourcesJar

Because when I start, I get the following error:

Could not find method uploadArchives() for arguments [build_ejkqjjnby5fggiavovparsecy$_run_closure5@c0f0c25] on project ':authenticator_sdk' of type org.gradle.api.Project

like image 886
Morozov Avatar asked Sep 03 '25 09:09

Morozov


1 Answers

After I have read the documentation in more detail here and here,

I was able to rewrite my problematic code section as follows:

publishing {
    repositories {
        maven {
            url = uri("${rootProject.projectDir}/maven-repo")
        }
    }
}
like image 92
Morozov Avatar answered Sep 04 '25 23:09

Morozov