To those reading this comment: I had this same error and solved it in a ridiculously absurd way.
Build -> Clean Project
This is the solution and I couldn't solve it for an hour.
Build -> Clean Project
does not necessarily solve the problem, but it is worth a try.