Is your ex naturalized? If not, you're still on the hook for the I-864
To share a little bit of my experience with you: I'm the foreigner. I divorced my American husband and married another foreigner within a month of my divorce. I sponsored his green card and ultimately he got naturalized. It all went smoothly.