Produce Flame (Player's Handbook, p. 269) creates a small, persistent flame that grants vision and can, optionally, be thrown at someone to make an attack. The Spell Sniper feat (p. 170), in addition to making spell attacks more accurate, allows the character to learn a cantrip that "requires an attack roll." By RAW, can I pick Produce Flame with the Spell Sniper feat, or does it not require an attack roll?
I would allow it, but since as you say, Produce Flame does not in fact "require" the attack roll, I would say RAW you could not choose it.
RAI, I think it works -- if you want to attack with Produce Flame you make an attack roll rather than having the target make a save (or just get auto-hit, as with Magic Missile). So RAI, since Produce Flame is one of the type of spells that Spell Sniper works well with, I think it's a valid choice.
Yes, you can pick Produce Flame.
The distinction about 'requires an attack roll' isn't about Produce Flame's uses that don't require an attack roll. It's about the difference between combat Cantrips that require an attack roll and are affected by partial cover (i.e. Produce Flame) verses ones that force a saving throw and ignore cover (i.e. Sacred Flame).
The damaging part of Produce Flame requires an attack roll to hit, and is affected by partial cover. So, it qualifies. Just like Chill Touch, Fire Bolt, Eldritch Blast, etcetera.
Cantrips like Sacred Flame, Poison Spray, Acid Splash require saving throws, are unaffected by partial cover, and don't qualify.