nmcli the WiFi network could not be found

Solution 1:

this one fixed the issue for me - https://unix.stackexchange.com/a/519620/407616
add this

[device]
wifi.scan-rand-mac-address=no

to /etc/NetworkManager/NetworkManager.conf
then run

sudo systemctl restart NetworkManager

then you can connect to the ssid by

sudo nmcli dev wifi connect "SSID" password "wifipassword"

Solution 2:

I never found a fix for the issue, but I believe I found the problem. I was using a virtual interface made with

sudo iw dev wlan0 interface add ap0 type __ap

to host a WiFi network, but ap0 and wlan0 had the same MAC address. Due to a problem with the RPi3 drivers, I couldn't change the MAC address(I tried macchanged -e ap0), but if I figured out how to, I'm pretty sure the issue would have been resolved.