I also encountered this issue in my Android project.
No matter what I tried at work, I couldn't solve the problem. Later, I checked the project again at home and noticed that it was getting stuck on a file related to one of my custom attributes — specifically one used in a custom button.
Even though the file didn't seem to have any obvious problems, I decided to delete it, rebuild the project, and then add it back.
Surprisingly, that solved the issue.
I hope this helps!