java.lang.NoClassDefFoundError: com/android/build/gradle/AppPlugin
See original GitHub issueGradle 4.4.1, Android Gradle Plugin 3.0.1
I’m trying to add the plugin to https://github.com/hzsweers/CatchUp via the plugins
block in the top-level build.gradle
file. The build fails with the following error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> Could not resolve all dependencies for configuration ':app:kapt'.
> A problem occurred configuring project ':bypass'.
> Failed to notify project evaluation listener.
> com/android/build/gradle/BaseExtension
> com/android/build/gradle/BaseExtension
Here’s a part of the stacktrace that looks relevant:
Caused by: java.lang.NoClassDefFoundError: com/android/build/gradle/BaseExtension
at org.jlleitschuh.gradle.ktlint.KtlintPlugin$addKtLintTasksToAndroidKotlinPlugin$1$1.execute(KtlintPlugin.kt:72)
at org.jlleitschuh.gradle.ktlint.KtlintPlugin$addKtLintTasksToAndroidKotlinPlugin$1$1.execute(KtlintPlugin.kt:26)
at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:91)
at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:80)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)
... 153 more
Caused by: java.lang.ClassNotFoundException: com.android.build.gradle.BaseExtension
... 161 more
Any special considerations when running the plugin on Android?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
java.lang.NoClassDefFoundError: com/android/build/api ...
Hi there, I got this from Google Publish API when I was trying to publish apk to play store internal track from Bitbucket...
Read more >java.lang.ClassNotFoundException: org.gradle.api.internal ...
It looks like one of your plugins (a jetbrains plugin of some sort) is not compatible with Gradle 6. I'm guessing you could...
Read more >AGP 7.2.0-alpha06 is not compatible with androidx.navigation ...
Exception is: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension at androidx.navigation.safeargs.gradle.
Read more >Known issues with Android Studio and Android Gradle Plugin
lifecycle:lifecycle-runtime in your module. If you're seeing java.lang.NoClassDefFoundError: Could not initialize class androidx.customview.poolingcontainer.
Read more >java.lang.NoClassDefFoundError: org/jetbrains/plugins/gradle ...
Hi, I am an intellij plugin developer. I want to extend Gradle plugin to auto import a new project that is created in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If anyone is still facing this issue, then please check the compatibility of Gradle version used in the project and the version of Gradle plugin which studio is using
Oh right, that makes sense. The old way seems to work, thanks for the help!