Anki won't open if i have a different keyboard layout with setxkbmap

Try updating Anki or the other steps listed at Troubleshooting - Anki Manual.

This has been reported before:

But it seems like an old issue. I’m seeing another report from Feb this year.