I’m writing this article to help you solve this issue as fast as possible.
As you probably already know after some googling around, the main solution for this issue is to create ads.txt file and host it on your web site. With some luck, in a day or two, after Google crawls your website, this error should disappear on its own.
However, it is not that simple. Creation of ads.txt is just a part of a solution.
There’s one crucial information Google does not disclose, at least not on the main page. Let me give you an introduction on the example of my blog. My domain is www.gajotres.net. I was always too lazy to also enable non-www domain gajotres.net, such a huge mistake. What Google forgot to state is that crawling, in this case, starts from your non-www domain (sub-domains are excluded) and transitions to your www domain. The crawling process will fail if you have not correctly configured your non-www domain, or if it is not forwarded to your www domain.
As my blog is Apache-based, these few lines solved my problem (included in the .htaccess file):
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]