i had the same problem and was about to trade in my new Pixel XL 2. Before you replace your screen protector or do a factory reset, take a soft cloth (preferably microfiber) and clean the top part of your screen really well, with a little elbow grease. I did this and my proximity sensor works...