简体   繁体   中英

Execution failed for task ':backend:endpointsClientLibs' when increasing com.android.tools.build:gradle version

I get this error when I try to upgrade my project level gradle from 'com.android.tools.build:gradle:7.0.4' to 'com.android.tools.build:gradle:7.2.2' (Or anything higher than 7.0.4 in general):

Unable to find method ''java.lang.reflect.Type com.fasterxml.jackson.databind.introspect.AnnotatedField.getGenericType()''
'java.lang.reflect.Type com.fasterxml.jackson.databind.introspect.AnnotatedField.getGenericType()'

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.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

The error in the logs says:

Execution failed for task ':backend:endpointsClientLibs'.
> 'java.lang.reflect.Type com.fasterxml.jackson.databind.introspect.AnnotatedField.getGenericType()'

Looks like it is related to the cloud endpoints module I have.

Is there a fix for this so I can have a higher gradle version for my project?

Update your Android Studio and it'll ask you to update your gradle plugin which created issues with your running projects. Change your distribution url in gradle-wrapper.properties with the latest one.

distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip

(permanent link list here: https://services.gradle.org/distributions/ )

  1. Go to the project section and select gradle scripts menu.
  2. Under script, menu select gradle -wrapper.properties
  3. Then replace the distributionUrl with the latest one.

在此处输入图像描述 note: distributions gradle will change depended upon the version of the android studio.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM