I've recently upgraded from 1.2.2
to 1.3.2
and was introduced with the following error:
Error:Unable to load class 'org.gradle.api.publication.maven.internal.DefaultMavenFactory'.
Possible causes for this unexpected error include:
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
- You are using JDK version 'java version "1.7.0_79"'. Some versions of JDK 1.7 (e.g. 1.7.0_10) may cause class loading errors in Gradle. Please update to a newer version (e.g. 1.7.0_67).
Open JDK Settings
- Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
- The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)
- Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
My project is using the SquiDB library if that matters, has anyone encountered similar error and could help me out how to fix it?
if your gradle.properties
file which is located at the root level of your project contains :
classpath 'com.github.dcendents:android-maven-plugin:1.2'
,
try to change to:
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
I solved the same problem in this way, and hope you will as well.
I don't know why but following has worked:
Open the Settings panel
Go to Build, Execution, Deployment > Build Tools > Gradle
On right in the form under the Project-level settings
heading select Use default gradle wrapper (Recommended)
In my case I had selected Use local gradle distribution
for some reason.
if you know the reason behind the issue and solution applied please add another answer with explanation and I will make it accepted.
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