2022 Nissan Sentra won’t start

The battery tests as good

If I skip one day driving it will take at least 7 tries for my Sentra to start. Could it be the alternator?

The engine light is in and occasionally when starting the warning of car key not close enough to start switch shoes up when it’s right next to it. I replaced the battery for the key no change