This is usually one of two phone settings. The app needs extra permissions to discover devices on your network.
First, check these two things on your phone: make sure Bluetooth is turned on, and make sure location services (or GPS) are turned on. The HP Smart app uses these to find your network and the printer.
If that didn't work: The printer's own setup mode probably expired. On the printer screen, swipe down, tap the arrow, go to Network Setup, and hit Restore Network Settings. Tap 'Yes', wait a full minute, then kill and reopen the HP Smart app on your phone.
Heads up: The app notes it's not actually sending your location data to HP during this process; it's just using the phone's location services to help with local network discovery.