srs / gradle-node-plugin

Gradle plugin for integrating NodeJS in your build. :rocket:
Apache License 2.0
864 stars 212 forks source link

Compatible with gradle 7.1 not working #380

Open deanhiller opened 2 years ago

deanhiller commented 2 years ago

I think it is a version issue. I ran into this when re-using the file https://github.com/shekhargulati/gradle-react-app/blob/master/build.gradle . I upgraded the version of the plugin to the latest and got this error ->

Could not find method layout() for arguments [pattern, com.moowork.gradle.node.task.SetupTask$_addRepository_closure5$_closure7@2a9dd171] on object of type org.gradle.api.internal.artifacts.repositories.DefaultIvyArtifactRepository

Inside my react-native project android is using gradle 7.2 so I was hoping to match that version.

chrisr3 commented 2 years ago

I am seeing an exception like this too:

Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method layout() for arguments [pattern, com.moowork.gradle.node.task.SetupTask$_addRepository_closure5$_closure7@1251e743] on object of type org.gradle.api.internal.artifacts.repositories.DefaultIvyArtifactRepository.
        at org.gradle.internal.metaobject.AbstractDynamicObject$CustomMissingMethodExecutionFailed.<init>(AbstractDynamicObject.java:190)
        at org.gradle.internal.metaobject.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:184)
        at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:86)
        at com.moowork.gradle.node.task.SetupTask$_addRepository_closure5.doCall(SetupTask.groovy:182)
        at org.gradle.util.internal.ClosureBackedAction.execute(ClosureBackedAction.java:72)
        ...

Gradle 7.4.2.

deepy commented 2 years ago

There's more history in https://github.com/srs/gradle-node-plugin/issues/315, but the short of it is that this repository is no longer actively developed and does not work with Gradle 7 (or even 6 I think) Luckily there's a community fork that's actively developed and has Gradle 7 support https://github.com/node-gradle/gradle-node-plugin