function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
davehart55davehart55 

APEX deploy fails "Package Version number does not exist"

Hi there, this is doing my head in.

 

I am trying to deploy a really simple class and a trigger which is working fine in my developer org across to my production org. I'm using the Force.com IDE in Eclipse.

 

When I go to deploy it I always get "The specified Package Version number does not exist for that Package".

 

Well that's true - I have a managed package installed in my DE which is newer than the version in my prod org, BUT (for this class) I DO NOT CARE. The new class has nothing whatever to do with the managed packages (which are the not-for-profit stuff from SFDC foundation, if that matters).

 

The class really is NOT dependant on the managed package, but I can't convince the deployment wizard that this is the case.

 

I've tried deleting the "packageVersions" entries in the class metadata XML, but they always come back again - even if I try to push the class back to the DE, the metadata always seems to flow back in the wrong direction.

 

I'm changed them to match the old package version that I have in my Production org, but they always get reset again.

 

In the DE org itself, I can see where these packageVersions dependencies get set, but I can't change them there - or remove them.

 

I don't want to upgrade the managed package in the production org (too risky), and I can't downgrade the version in my DE (it's deprecated).
 I just want to allow the deployment to continue regardless of this irrelevant package being different.

 

Any ideas?

Best Answer chosen by Admin (Salesforce Developers) 
Sean TanSean Tan

Try setting your project to work offline. Edit the metadata file and remove the dependencies on the manage package, then deploy straight to the target org (do not go back to working online).

All Answers

Sean TanSean Tan

Try setting your project to work offline. Edit the metadata file and remove the dependencies on the manage package, then deploy straight to the target org (do not go back to working online).

This was selected as the best answer
davehart55davehart55
You the man. Thanks.

Obvious with hindsight - but only when you know it...

Of course its a workaround that shouldn't really necessary. But I'm getting used to that with sfdc.
Kunaal PatodiaKunaal Patodia
What do you mean by Setting the project to offline ? Are you talking about any particular tool/IDE ?