I am working with Android Studio 3.1 Canary 6 and I am getting this error when I build my project. I search this error and many users get this with different reasons, but I did
Its smart answer is that there is some syntax error in your Code may be in Java file or XML. Fix them first. Error will gone. work 100 percent for me every time