# NoSuchMethod exception in Gradle Plugin

**URL:** <https://discuss.gradle.org/t/nosuchmethod-exception-in-gradle-plugin/27822>\
**Category:** Help/Discuss\
**Tags:** issue-resolved, plugins\
**Created:** [July 20, 2018, 11:34am UTC](https://discuss.gradle.org/t/nosuchmethod-exception-in-gradle-plugin/27822 "2018-07-20T11:34:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roman](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@Roman](https://discuss.gradle.org/u/Roman)\
**Post date:** [July 20, 2018, 11:34am UTC](https://discuss.gradle.org/t/nosuchmethod-exception-in-gradle-plugin/27822/1 "2018-07-20T11:34:41Z")

</div>

Hi there,

I’m currently working on a plugin which should bring P2 support to Gradle. I know, that the dependency resolution process of Gradle is not meant to be extended. But I already had a first successful run in a test environment.

How ever, after I pushed the plugin to the Gradle Plugin portal and added it to a distinct project, the resolution process did fail. Because I wanted to avoid to write my own metadata types (which seems rather complex), I reused the `DefaultMutableIvyModuleResolveMetadata` class from the Gradle internals. As mentioned before this was not a Problem in my test run. But when I tried to build my real project, i got following exception:

```gradle
java.lang.NoSuchMethodError: org.gradle.internal.component.external.model.DefaultMutableIvyModuleResolveMetadata.<init>(Lorg/gradle/api/artifacts/ModuleVersionIdentifier;Lorg/gradle/api/artifacts/component/ModuleComponentIdentifier;)V

```

This is the constructor I use to create the metadata object. Can someone explain my, why it’s not accessible to Gradle? It’s a public constructor of a public class.

---

<div class="post-metadata">

**Author:** ![Roman](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@Roman](https://discuss.gradle.org/u/Roman)\
**Post date:** [July 20, 2018, 11:43am UTC](https://discuss.gradle.org/t/nosuchmethod-exception-in-gradle-plugin/27822/2 "2018-07-20T11:43:57Z")

</div>

Never mind, I used two different versions of Gradle and the constructor I used was removed in the newer one…
