anyone facing similar issue here with solution from ionic support worked for me
Thanks for reaching out to Ionic Support!
**This could be an issue with the capacitor. Our engineering team has published a workaround here: Suddenly gradle build not working anymore · Discussion #4542 · ionic-team/capacitor · GitHub **
Give it a try and let us know if you have any further issues.