Yes, You can learn Green Flame Blade with Spell Sniper
We know from Jeremy Crawford's tweet that
Spell Sniper does work green-flame blade.
At least as far as increasing the range is concerned. Spell Sniper specifically says:
When you cast a spell that requires you to make an attack roll, the spell’s range is doubled.
Since Green Flame Blade is confirmed to work with the range increase of spell sniper, then Green Flame Blade must be a spell and it must require an attack roll. If it didn't meet these requirements, it wouldn't be valid for a range increase.
The cantrip that you learn from the spell, as it has been pointed out, is:
one cantrip that requires an attack roll
Well, Green Flame Blade is a cantrip. And we know that it requires an attack roll, because it fulfills that same requirement for the range increase in the other benefit. And Green Flame Blade is on several of the allowed class spell lists. Since there are no other restrictions, Green Flame Blade meets all requirements to be learned from this feat.