Problems migrating to Capacitor 4

We have just migrated to Capacitor 4 and are now facing an issue where we can’t change bundle id using the ionic extension in vscode. We do this to target different environments we are deploying our app to.

This is the output i get:

Set iOS Bundle Id for target App buildConfig.Debug to
Set iOS Bundle Id for target App buildConfig.Release to
Set Android Package Name to
[error] Unable to setPackageName for android: Error: Unable to load or parse gradle file: Error: Could not find or load main class com.capacitorjs.gradle.Parse
Caused by: java.lang.ClassNotFoundException: com.capacitorjs.gradle.Parse

Any ideas what’s causing this, or how it can be fixed?