10

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?

prograde
  • 2,620
  • 2
  • 23
  • 32

2 Answers2

18

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.

John C
  • 245
  • 3
  • 7
  • Same issue, I was using gradle 1.10 in my PATH and 1.9 for the project. Changed PATH to reference 1.9 and problem solved. – Jacob Tabak Dec 24 '13 at 15:44
5

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.

JJD
  • 50,076
  • 60
  • 203
  • 339
Daniel Kao
  • 354
  • 2
  • 7