A different approach that you can explore is the command r.report
from GRASS in the processing toolbox.
The GRASS man page is here: https://grass.osgeo.org/grass74/manuals/r.report.html
And these are the screenshots from QGIS 2.18.14. In the picture below the raster has only one category value (1) and the result is in km^2 (k).