The layout <layout> in layout has no declaration in the base layout folder [error]
In my case closing and reopening Android studio solved the problem. Rebuilding the project or clearing the cache didn't help.
In my case it was the use of capital letters in the file name. I left everything in lowercase and it was fixed.