So, I made a new Android project with the default sign in activity. Since then, I have made some changes to GUI through the XML. But then, when I tried to add a new Java class. I have encountered this error I haven't added any new Java code to the template before doing so before, since starting this project. I looked around this site for a solution.
So it is the same problem, but a different cause.
UPDATE 8/15/17
I did what star4z recommended. I made a new Android project with the default sign in activity template. That's all I did. I didn't do any XML changes at all this time. Then, as soon as I added a new Java class, I encountered the same error.