All Collections
Troubleshooting
Comparisons and deployments
Are you getting "Invalid api version" when deploying Apex classes?
Are you getting "Invalid api version" when deploying Apex classes?
Valerio Chang avatar
Written by Valerio Chang
Updated over a week ago

Behavior 

When deploying an Apex class from source to target it is possible to get the error in the format of: 

Invalid api version:<insert version number>

 For example:

Invalid api version:45.0

Root cause

This is often because the target org has not been upgraded to the higher version number, yet that is available in the source.

This is where the Apex class version number is specified:

Resolution 

You can change the version number on the source to one that is compatible with the target org. If your target is on version 44.0, reduce the version number of the Apex class in the source to 44.0 and your deployment error should be resolved.

Let me know if that helped you out using the reactions below!

Did this answer your question?