If it's a 'global match' as in a battle with someone else, than no.
If you're ever in a battle in the Battle Frontier facilities, or in a battle with another player, you will never get experience.
This applies to all games.
How to change your username
How to add a user avatar
Why was my post hidden?
Flags vs Downvotes
Official PokemonDb League
Type a Pokemon name, type, move or ability to see instant results.