“I think the affordable housing plan works for the people of the city because it is for everyone. It is meant to reach working-class people, middle-class people, low-income people,” Mr. de Blasio said last week at an unrelated news conference in Queens.

City officials say they have taken a holistic approach to address homelessness by preventing homelessness. The city rebuilt its rental assistance program and provides legal services to tenants facing eviction.

As a result, 38,000 families comprising 100,000 people have exited shelters or been prevented from entering shelters, the city said. The number of people in the city shelter system remained flat in 2017, the first time in more than a decade.

“I don’t want to send a message that the only folks who can get affordable housing are folks who end up in shelter. I think that’s wrong for everyone,” Mr. de Blasio said.

Increasing the minimum amount of housing for the homeless would also make it more difficult to finance affordable housing projects. In order to make affordable buildings financially sustainable, there has to be the right mix of people from all incomes, city officials said.

City officials estimate that it costs $433,180 and takes five years to develop a newly built unit that is set aside for the homeless. Jaclyn Rothenberg, a spokeswoman for the mayor, said building new apartments is a “much more expensive and slower option than providing things like rental assistance.”

“This bill would undermine the flexibility we need to adapt to the market and continue delivering housing for homeless New Yorkers as well as low-income New Yorkers and those on the brink of homelessness,” said Matthew Creegan, a spokesman for the Department of Housing Preservation and Development.