As the contentious City Council hearings continue on Mayor Bill de Blasio’s proposals for affordable housing, one thing is clear: Failure is not an option.

The mayor’s inability to communicate, provide details, listen to all involved, and compromise have led to the demise of some signature initiatives, most recently, his desire to limit the horse carriage industry.

This time must be different.

The creation of affordable housing through rezoning is one of de Blasio’s big ideas, and it has two main components. “Mandatory inclusionary housing” would require developers in designated neighborhoods to earmark at least 25 percent of units as “affordable.” The other change, “zoning for quality and affordability,” would allow developers to build taller and add elements like courtyards in exchange for more affordability, particularly for seniors.

But the plans have come under tremendous fire, particularly from community boards and residents who worry they’ll be priced out as density and gentrification come in, and that this will all happen without their say-so.

In part, the vehement “no” emerged because City Hall fumbled at the start. Better communication, a clearer explanation of the steps yet to come and more community input earlier would’ve helped. But it’s not too late. Yesterday’s City Council session showed that with the right tone, and answers to key questions, policy can overcome rhetoric.

For the mandatory inclusionary zone, approval is just the beginning. Neighborhoods, starting with East New York, would then create their own particular zoning plans. They could tweak details, create parameters and density limits and make sure infrastructure needs are met.

Before any of that, changes to the overall programs are needed. Most important, to meet the tremendous need, the percentage of affordable units in each development must increase to create a better balance between market-rate and affordable housing. And the program must reach people with lower incomes.

First, city officials must listen. Then they must communicate fully and get this done right. If it fails, we all will lose.