Reputation: 220
this error came up when turned on my PC. And opened the Android Studio. The Gradle build took longer than normal and when it finally built there was this error. It is may be caused by the wrong committing my work from PC to my laptop (through GitHub). But I am not sure I am new here so It may also not be caused by this. Thank you for all the answers.
I have tried to open and close AS on both devices and update them. And also tried to regradle them.
AppName: sync failed date Failed to notify build listener.
Run build:
org.gradle.internal.exceptions.LocationAwareException: Failed to notify build listener. <76 internal calls>
Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify build listener. <8 internal calls>
Caused by: java.lang.AbstractMethodError <54 internal calls>
Build model'org.jetbrains.plugins.gradle.model.BuildScriptClasspathModel' for root project 'AppName':
java.lang.AbstractMethodError <135 internal calls>
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
On my laptop, it is working but not on PC. I can´t view my XML preview and not even pull things from GitHub.
Upvotes: 21
Views: 35693
Reputation: 121
I was also having same issue due to some bug in latest gradle and AGP. I fixed it by downgrading my gradle version from 8.2 to 8.0 and AGP version from 8.2.2 to 8.1.1. Refer to this link to see version compatibility.
Upvotes: 0
Reputation: 1683
This is what you should do.
1. Create a new kotlin project from the machine you are working.
2. Check files: build.gradle(Proyect:Nameyourproject), build.gradle(Module:app), gradle-wrapper.properties
3. Those files configuration should match your proyect being imported configuration
4. Go to your imported project again, go to build.gradle file and clic 'Try again' or the button in the toolbar that says Synchronize with graddle
I hope this helps.
Greetings
Upvotes: 0
Reputation: 1286
The error comes when the gradle build tools don't match with the Android Studio Version you are using. There are two possible ways to solve this;
Downgrade the gradle tools version;
eg
From classpath 'com.android.tools.build:gradle:3.5.3'
to
classpath 'com.android.tools.build:gradle:3.2.1'
.
Update your Android Studio to match your gradle version
Upvotes: 5