Unable to apply custom plugin

This was working yesterday, But since I started making changes to my plugin I have been unable to apply plugin anymore (though I have reverted most of the changes and dependencies).

A problem occurred evaluating project ':aws'.
> Failed to apply plugin [id 'xxxx.aws']
   > Could not find which method apply() to invoke from this list:
       public abstract void org.gradle.api.plugins.PluginManager#apply(java.lang.Class)
       public abstract void org.gradle.api.plugins.PluginManager#apply(java.lang.String)
       public abstract void org.gradle.api.internal.plugins.PluginManagerInternal#apply(org.gradle.api.internal.plugins.PluginImplementation)

Am trying to understand, whats the possible reason for the above.
And some more detail is that my plugin was coded with gradle 3, but the project thats using the applying the plugin is running gradle 2.3

My bad. It was a problem with my plugin code.