You'll need to paper-file your return as the IRS will continue to reject your attempts to e-file. You can ask your ex to amend their return by removing the dependent. Amendment processing can take weeks, even months, which is why it's best to paper-file your return in the meantime.
If he does not amend his return, the IRS will eventually contact both of you to figure out who gets to claim the dependent. The losing party will then be liable for any additional taxes, penalties, and/or interest as a result of the false claim.