10
votes

I imported an Android project from Eclipse to Andriod Studio, but when I compile, I get these errors. What do they mean?

Gradle: : org.gradle.api.plugins.PluginInstantiationException: Could not create plugin of type 'AppPlugin'.
Gradle: : java.lang.NoClassDefFoundError: org/gradle/tooling/provider/model/ToolingModelBuilderRegistry
Gradle: : java.lang.ClassNotFoundException: org.gradle.tooling.provider.model.ToolingModelBuilderRegistry

I don't think it has anything to do with my code, since it all worked in Eclipse. On the other hand, I get other projects created in Android Studio to run. Did I do something wrong when exporting or importing the project?

2

2 Answers

18
votes

I was having the same problem. Turned out it was because I had Gradle v1.4 installed. Once I upgraded to v1.6 (download and change path), these problems went away.

5
votes

I met same problem while starting using Android Studio, and tried to compile my app in command-line mode. The solution is simple:

  1. upgrade your Gradle to version 1.6 ( I am not sure if this is required)
  2. set up ANDROID_HOME in your environment. For me it's like this:

    export ANDROID_HOME="/Applications/Android Studio.app/sdk/"
    

and then, it should build your project successfully by using gradle build in your project root folder.