I agree with Maravilho Singa's answer. It appears to be a bug in gradle.
I found another solution here:
removing the .gradle directory in the root project directory will fix the problem.
Just delete the .gradle directory and rebuild app. Undo Try to bring back .gradle directory. There by your error will be removed.
I think it has something to do with iCloud. I've found that each time that happens with my projects it's because the .gradle file had been uploaded into iCloud and was no longer available in my computer. So either delete the .gradble file and have it regenerated, or recover it from iCloud by clicking it.
That's all. It will work perfectly
delete the .gradle file from the root directory and then clean the project, by this your .gradle file be recreated and your error will be resolved.
This is gradle bug. Go to your project folder, delete your gradle and build folder. Sync the project with gradle files. This will resolve the problem.
I am working on my project and suddenly lights goes off, When i started Android studio and run the project, At the moment Android studio syncing the Gradle, And the same problem occurs.
Solution=> Please Tack Backup of your project before proceeding these tasks. Delete All folder and files present in Build folder and Gradle folder. Uploading Images That will help you.
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