'PWA Works Fine On Desktop But Shows "Does not register a service worker that controls page and start_url" on Mobile

I am trying to build a PWA here: https://pwa-testing.nearpicks.com

The service worker is at /sw.js

When I run the lighthouse test for PWA on chrome, it says that the PWA is installable on desktop. But when I run the same test for mobile, it gives the following error: "Does not register a service worker that controls page and start_url" and says that the PWA is not installable on mobile.

Can someone help me out, why is this happening?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source