The city took nearly four years to come up with barely half the safe havens it promised domestic-violence victims, The Post has found — and de Blasio bureaucrats gripe it’s all the fault of a hot housing market.

Advocates are decrying the lag in providing the sorely needed transitional housing, noting the mayor’s still-unfulfilled promise from 2015 to add 400 units.

Carmen Rivera, 44, told The Post she was trapped in a seemingly endless cycle of abuse at the hands of her longtime boyfriend before finally breaking free in 2000 — and that one of the Brooklyn shelters saved her life.

“I actually went to a shelter for battered women,” said the Rev. Rivera, now an ordained minister. “[It was] my lifeline, that’s what helped me transition and leave my batterer and start a new life.”

But the city has been dismally slow in recognizing the urgency of the situation, according to Rivera and other advocates.

There was a 15 percent increase in domestic violence-related killings and an 8 percent spike in domestic-incident reports between 2017 and 2018, records show.

Yet by March, the Department of Social Services had still only inked deals for 165 of the promised 400 new units with third-party contractors — despite the city comptroller approving $15 million in emergency funding in 2015 to speed up the process.

The private contractors typically rent out entire buildings from landlords and then provide the space — and their counseling services — to victims, with the city footing the bill for both.

By last month, the city approved another 130 units — although still leaving 105 additional ones to be provided.

The city’s goal is to offer a total of at least 643 domestic-violence units, including the 400 new ones, to victims on a temporary basis. There also are currently 2,689 emergency beds in shelters for single adults or families who have suffered from domestic violence.

But the Big Apple’s housing market is conspiring against the city’s efforts, officials complained to The Post.

Isaac McGinn, a spokesman with Social Services, said the current tight real-estate inventory makes it difficult to find affordable sites.

“Bringing on high-quality programs and facilities in locations to effectively meet the need can take time,” McGinn said.

Laura Fernandez, clinical department director for the non-profit Sanctuary for Families, said the lag also is a result of city bureaucracy, for example, how private providers are reimbursed.

“You would have to, as an agency, be ready to up-front all of the expenses to open the shelter,’’ she said.

“You have to get a building, you have to do work on the building, you have to ensure all the rooms have furniture in them, you have to be approved from the regulatory perspective, and you don’t start billing until you have a person sleeping in the bed.

Either way, the crisis is causing Rivera to question de Blasio’s commitment to survivors.

“Where on the priority spectrum do we fall?” she said. “We were made a promise. … What’s going on?”

Advocates note that if there is no domestic-violence housing available, victims go to regular homeless shelters. Yet the domestic-violence centers are designed especially for trauma victims: The locations are kept confidential to protect survivors and residents get counseling, help finding permanent housing and childcare services.

Alida Tchicamboud, a survivor and spokeswoman for Sanctuary for Families, said the difference between the two housing options is stark.

She would know. She and her three girls have stayed in both.

At a recent City Council hearing, Tchicamboud testified that her temporary home in a domestic-violence facility “defeated all the stigma I had of a homeless shelter.”

“The facility was clean, well-maintained, and the staff was property trained to deal with [domestic-violence] clients,” she said.

When Tchiacamboud wasn’t able to find permanent housing, she had to go to a regular homeless shelter because the domestic-violence facilities were full.

She summed up that experience with one word.

“Nightmare,” she said.