Android Studio : Could not create plugin of type 'AppPlugin'

pvllnspk picture pvllnspk · Jul 7, 2014 · Viewed 9.6k times · Source

I know that there are a lot of similar questions, but no one answer works for me.

Android Studio 0.8.0

   dependencies {
        classpath 'com.android.tools.build:gradle:0.12.+' (the minimum supported version - from tip)
    }

Gradle 1.4
------------------------------------------------------------

Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.9.3 compiled on April 8 2014
Ivy: non official version
JVM: 1.7.0_55 (Oracle Corporation 24.51-b03)
OS: Linux 3.13.0-29-generic i386

    What went wrong:
    A problem occurred evaluating project 
    > Could not create plugin of type 'AppPlugin'.


Caused by: org.gradle.api.plugins.PluginInstantiationException: Could not create plugin of type 'AppPlugin'.
    at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(DefaultPluginRegistry.java:65)
    at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.providePlugin(DefaultProjectsPluginContainer.java:106)
    at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.addPluginInternal(DefaultProjectsPluginContainer.java:71)
    at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.apply(DefaultProjectsPluginContainer.java:37)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
    at org.gradle.api.internal.project.AbstractProject.apply(AbstractProject.java:854)
    at org.gradle.api.Project$apply.call(Unknown Source)
    at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
    at org.gradle.api.Script$apply.callCurrent(Unknown Source)
    at build_6m1kibqbisaqktcdt8jnr2gj31.run     /build.gradle:9)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
    ... 32 more
Caused by: java.lang.NoClassDefFoundError: org/gradle/tooling/provider/model/ToolingModelBuilderRegistry
    at org.gradle.api.internal.DependencyInjectingInstantiator.selectConstructor(DependencyInjectingInstantiator.java:97)
    at org.gradle.api.internal.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:58)
    at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(DefaultPluginRegistry.java:63)
    ... 45 more
Caused by: java.lang.ClassNotFoundException: org.gradle.tooling.provider.model.ToolingModelBuilderRegistry
    ... 48 more

Answer

vRallev picture vRallev · Jul 7, 2014

Are you really using Gradle 1.4? Only Gradle 1.10, 1.11 and 1.12 are supported at the moment. Either download a new Gradle version (as far as I know 2.0 is not supported, yet) or change the Gradle wrapper to one of the mentioned versions.