upgrade gradle to v6.1.1 unable to find method [closed] - android-studio

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Unable to find method 'org.gradle.api.tasks.TaskInputs.property(Ljava/lang/String;Ljava/lang/Object;)Lorg/gradle/api/tasks/TaskInputs;'.
Possible causes for this unexpected error include:
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.

It is useful to work through the documentation here, in case any of the detail helps with resolution:
https://docs.gradle.org/current/userguide/upgrading_version_5.html#changes_6.0
My issue turned out to be related to a specific third party plugin, Greendao3GradlePlugin.
I have documented my failed steps too so that others can avoid unnecessary steps.
./gradlew build fails with error: Failed to notify project evaluation listener.
Steps to resolve:
Upgrade JDK to version 9: Failed to resolve.
Download and install JDK 9: Failed to resolve.
Install SDK 30.0: Failed to resolve.
Add configurations.all {
resolutionStrategy.capabilitiesResolution.all { selectHighestVersion() }
} to build.gradle: Failed to resolve.
Disabled all third-party plugins: Failed to resolve.
Upgrade to kotlin-gradle-plugin:1.3.72: Failed to resolve.
./gradlew --scan build revealed error comes from Greendao3GradlePlugin, suggesting this is a project-specific error. Solution is to resolve this specific issue.
Recommendation to others with this problem: use Gradle Build Scans to drill down into your build to find the problem third party plugin.

Related

After Android Studio update. Could not parse POM, Could not resolve all files for configuration ':app:_internal_aapt2_binary'

Hello I've been looking to other similar questions about this problem but none has helped me so far, after I updated to android studio to the new version 3.6.2 I have this error when I try to run any project.
Run info:
Execution failed for task ':app:mergeDebugResources'.
Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
Could not resolve com.android.tools.build:aapt2:3.6.2-6040484.
Required by:
project :app
Could not resolve com.android.tools.build:aapt2:3.6.2-6040484.
Could not parse POM https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/3.6.2-6040484/aapt2-3.6.2-6040484.pom
Content is not allowed in prolog.
Before the update the project was able to build now none of my projects build.
I tried invalidate cache and restart, I checked that I was not running in offline mode. still have the same failure. Any idea whay this could be and how I could fix it?
if you have problem with gradle
change your android stadio version to 3.6.2 or lower
file>project Strcture>
change to 3.6.2 and OK
I fixed the Error by going to my username and deleting .gradle, .AndroidStudio3.6 and .AndroidStudio3.5 folders. after I restarted android studio to download the folders again and resetting them. It worked.

Unable to find method 'org.gradle.api.tasks.SourceSetOutput.getClassesDir()Ljava/io/File;'

I tried to run an imported project in this repo
but I got this error:
Unable to find method 'org.gradle.api.tasks.SourceSetOutput.getClassesDir()Ljava/io/File;'.
Possible causes for this unexpected error include:
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.
I used android studio version 3.4.1, and Gradle version 5.1.1.
anyone can help please.
I was getting the same error and fixed it by updating a dependency in the backend module:
classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.2'
to
classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.3'

Unable to load class 'groovy.lang.GroovyObject'

since I upgraded to android studio 3.0.1 I can not continue with my application. Gradle throws the following error: Gradle Sync Issues
Error: Unable to load class 'groovy.lang.GroovyObject'. Possible causes for this unexpected error include: Gradle's
dependency cache may be corrupt (this happens 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 Grade requested by the
project. In the case of corrupt Gradle processes, you
can also try to close the IDE and then killing all Java processes.
Any suggestions? Thank you very much.
If you made an update to Android 3.0+ do not forget to perform the cache invalidation in Android Studio and restart.
File > Invalidate Cache / Restart
You can try doing the compilation by command line, through the terminal that has integrated Android Studio:
./gradlew clean assemble
I have changed the following line in project's grandle.wrapper.properties file:
From:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
to
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
After that i could successfully build my project again.
Not sure why it was not working with version 4.1 since both versions exists in %HOMEPATH%\.gradle\wrapper\dists folder.

Android studio shows error after importing my project

I am very new to android studio and development. I have imported my project into the android studio and it shows the below error.
Error:(20, 0) Unable to load class
'org.bouncycastle.operator.OperatorCreationException'. Possible causes
for this unexpected error include: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.
Can any one help me out to resolve this

Gradle compile error

I´m getting this error running my app
Possible causes for this unexpected error include: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.
Anyone knows how can i fix it?

Resources