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?
Solution: Go in File -> Project Structure -> Project Settings -> Project and set Project SDK to Android API 30 Platform (or the latest). Go in File -> Project Structure -> Project Settings -> Modules and select the Dependencies tab and choose Android API 30 Platform in the Module SDK dropdown.
Sometimes the cache gets corrupted due to which Gradle sync fails.
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.
I met same problem while starting using Android Studio, and tried to compile my app in command-line mode. The solution is simple:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With