Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The error "java.lang.NoClassDefFoundError" occurs when the Java Virtual Machine (JVM) cannot find a particular class at runtime. In the case of Android and Gradle 7.x, this error can occur when there is a local Maven repository within another local Maven repository.

This can happen if you have a project with a dependency on a library that is located in a local Maven repository, but that library itself has a dependency on another library that is also located in a local Maven repository. When you try to build the project with Gradle 7.x, it may not be able to resolve the dependencies correctly, resulting in the "NoClassDefFoundError" error.

To fix this error, you may need to remove the nested local Maven repository or modify your Gradle build script to explicitly declare the dependencies and repositories to use. You can also try cleaning and rebuilding the project, or updating to a newer version of Gradle.