brodycj / create-react-native-module

MIT License
666 stars 52 forks source link

Build error with Gradle v7 - Plugin with id 'maven' not found. #471

Open novseje opened 3 years ago

novseje commented 3 years ago

When I build project with Gradle v7 I got error:

Plugin with id 'maven' not found.

For those using gradle 7, maven plugin has been removed, now you should use maven-publish, as described in official site at this link: https://docs.gradle.org/7.0/userguide/upgrading_version_6.html?_ga=2.21245883.1883799052.1624281891-1948725710.1624281891#removal_of_the_legacy_maven_plugin

So, instead of using: apply plugin: 'maven' you should use apply plugin: 'maven-publish'

jaydeep-reactnative commented 2 years ago

@novseje Still facing same error after changing plugin: 'maven-publish' & Gradle v7

aknad commented 2 years ago

Changing the plugin to 'maven-publish' solves the issue but now I've a new error:

Could not find method mavenDeployer() for arguments [build_entzzzqdm3f25a31lwmklzs9s$_run_closure4$_closure15$_closure17@5b19aaf] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.

mitchiemt11 commented 2 years ago

Changing the plugin to 'maven-publish' solves the issue but now I've a new error:

Could not find method mavenDeployer() for arguments >[build_entzzzqdm3f25a31lwmklzs9s$_run_closure4$_closure15$_closure17@5b19aaf] on repository container of type >org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.

Still facing this problem. Anyone with a solution?? @aknad any solution on this?

navaneeth-algorithm commented 2 years ago

A problem occurred configuring project ':react-native-tesseract-ocr'.

Could not find method mavenDeployer() for arguments [build_450w1e7my5x04n2mez1rogjko$_run_closure4$_closure15$_closure17@69dd66a3] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.

Same here , any solution for this problem?

navaneeth-algorithm commented 2 years ago

i just commented out and was able to run successfully

/*task installArchives(type: Upload) {
    configuration = configurations.archives
    repositories.mavenDeployer {
        // Deploy to react-native-event-bridge/maven, ready to publish to npm
        repository url: "file://${projectDir}/../android/maven"
        configureReactNativePom pom
    }
}*/
iasreact1 commented 2 years ago

@navaneeth-algorithm it was already commented out here but though the same issue occured any idea to solve the issue

Could not find method mavenDeployer() for arguments [build_1vgpslp8jdh77190hqiajl56s$_run_closure4$_closure16$_closure18@2a8bde30] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.

tkud04 commented 1 year ago

Commenting it out solved my case

ShooreshS commented 1 year ago

i just commented out and was able to run successfully

/*task installArchives(type: Upload) {
    configuration = configurations.archives
    repositories.mavenDeployer {
        // Deploy to react-native-event-bridge/maven, ready to publish to npm
        repository url: "file://${projectDir}/../android/maven"
        configureReactNativePom pom
    }
}*/

My project build successfully but cannot perform the read function.

The following is console error:

tesseract.min.js:2 Uncaught Error: Error: FS error
    at tesseract.min.js:2:39459
    at t.onmessage (tesseract.min.js:2:53506)
(anonymous) @ tesseract.min.js:2
t.onmessage @ tesseract.min.js:2
topzhanghj commented 1 year ago

i just commented out and was able to run successfully

/*task installArchives(type: Upload) {
    configuration = configurations.archives
    repositories.mavenDeployer {
        // Deploy to react-native-event-bridge/maven, ready to publish to npm
        repository url: "file://${projectDir}/../android/maven"
        configureReactNativePom pom
    }
}*/

sovle my problem ,thx !!!

Napsterwanp commented 1 year ago

or you can replace mavenDeployer to publications, such as

publishing {
        publications {
            release(MavenPublication) {
                from components.release
                groupId 'groupid'
                artifactId 'artifcatId'
                version 'version'
            }
        }
    }
hariantara commented 9 months ago

installArchives

should be inside installArchives ?

kavithareddyedula commented 7 months ago

what`s the equivalent to this all projects in Gradle 7 allprojects { apply plugin: 'maven-publish' uploadArchives { repositories.mavenDeployer { snapshotRepository(url: snapshotsRepositoryURL) { } repository(url: corporateRepositoryURL) { } } } repositories { maven { url 'https://artifactory.xyz.com/xyz/' }

alidavodii commented 5 months ago

i just commented out and was able to run successfully

task installArchives(type: Upload) {
        configuration = configurations.archives
        repositories.mavenDeployer {
            // Deploy to react-native-event-bridge/maven, ready to publish to npm
            repository url: "file://${projectDir}/../android/maven"
            configureReactNativePom pom
        }
    }
skumhar commented 1 month ago

i just commented out and was able to run successfully

task installArchives(type: Upload) {
        configuration = configurations.archives
        repositories.mavenDeployer {
            // Deploy to react-native-event-bridge/maven, ready to publish to npm
            repository url: "file://${projectDir}/../android/maven"
            configureReactNativePom pom
        }
    }

@alidavodii Here’s a refined version:

I commented out the code and was able to run it successfully, but as you know, these changes are in the node_modules folder. When the library is updated, the changes will be overwritten. How can I resolve this permanently?