question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.NoClassDefFoundError: com/android/build/gradle/AppPlugin

See original GitHub issue

Gradle 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:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
ganeshpadhayaycommented, Feb 19, 2020

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

0reactions
Egorandcommented, Dec 26, 2017

Oh right, that makes sense. The old way seems to work, thanks for the help!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found