You may be receiving this error because of a mismatch between your app's Java version and the Java Virtual Machine's (JVM) version. You can update your Java version by adding the Set Java Version Step to your Workflow and setting the Java version to be set globally for the build input variable.
Default Java version
The default Java version is 11.