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

Time:01-07

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

CodePudding user response:

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")
        }
    }
}
  •  Tags:  
  • Related