When I started using Adsense I was shocked that, after a few days with decent revenue, it suddenly dropped to 0. I had previously followed the steps to upload the right ads.txt file to my root domain, and I could see it by opening https://kobadoo.com/ads.txt.
After waiting for a week with the annoying message "Earnings at risk" being displayed and zero earnings, I figured out what the problem actually was. I was able to access ads.txt, but Google bots weren't.
My robots.txt file had this content:
User-agent: *
Allow: /index.html
Disallow: /
I changed it to the one below, and after a few hours the error message disappeared and the earnings came back to normal.
User-agent: *
Allow: /