Selected answers from the Dumb SEO Questions Facebook & G+ community.
Prashant kumar: Help me... Why is this error coming? I think, code looks good.
Federico Sasso: Very likely the robots.txt file contains a leading hidden character called BOM (Byte Order Mark) which, while actually valid for an UTF-8 document, is surprisingly not understood by Google parser (at least the one used in Search Console diagnostic tool).
For example, Windows notepad.exe adds it when saving the document as "Unicode" (Windows jargon for "UTF-8").
You have two solutions/workaround: 1) save the file without BOM character 2) or simply add a first line comment (e.g. "# who cares for BOM :)", it will be reported in Search Console as a non recognized line and ignored, but hey, it's just a comment!