Angry blacks booed and hurled bottles at President Carter's motorcade tonight as it was leaving a community center in the heart of Libery City, the inner-city section of Miami that was the scene of bloody rioting last month.

The president was not harmed, although one beer bottle struck the roof of his light-blue limousine. He later told reporters at the Miami airport that he had not been aware of the incident outside the James Scott community association building.

A photographer riding in a press car behind the presidential limousine was struck by a beer bottle and was thrown off the moving car. He apparently was not injured seriously.

The violent scene erupted as Carter was leaving a meeting with community political and business leaders at which he pledged to "meet you at least halfway" in rebuilding riot-torn areas.

Emerging from the meeting, the president, surrounded by Secret Service agents, was greeted by booing and some wadded-up pieces of paper tossed in his direction. When he waved, the booing grew louder.

Carter entered his limousine and the motorcade quickly pulled away as more wads of paper and some bottles were thrown. Drivers of other motorcade cars, their horns blaring, threaded their way out of the area among scores of running people, some of whom jeered and made obscene gestures.

The melee was the most violent that Carter has encountered as president.

Rioting erupted in the black section of Miami May 17 after four white former policemen were acquitted in the beating death of a black Miami insuranceman, Arthur McDuffie. The rioting claimed 15 lives and, according to Mayor Maurice Ferre, caused at least $100 million in property damage.

The president arrived in Liberty City late this afternoon, driving from Miami Beach, where he had delivered a speech, past a number of burned-out buildings in the riot area.

He encountered several hundered black demonstrators on his arrival at the community center. The demonstrators held signs that read, "Remember McDuffie," "Hey, Mr. Peanut Man, We Need More than Peanuts" and "Hail to the Chief Racist."

Opening the meeting with the Miami leaders, Carter made his promise to "meet you at least halfway." But he also warned that it would be "a very serious mistake" to think that the federal government will pay the full cost of restoring the riot area, and he made no specific commitments on additional federal aid.

Reporters were allowed to witness the president's opening remarks. But after a few minutes, when White House officials ordered reporters to leave, a noisy dispute developed between them and several Miami reporters. they charged that closing the meeting violated Florida's "sunshine law," which requires that meetings involving two or more elected officials to be open to reporters.

A Secret Service agent, backed up by Dade County police, finally forced the reporters to leave.

Earlier today, speaking at a hotel across Biscayne Bay from the scene of the rioting, the president asked poor Americans to "keep the faith" in his commitment to protect them from the worst effects of the recession.

"Just as we have taken effective steps to reduce inflation, I want you to know, I want the country to know, that we have the existing programs and new proposals to cushion the effects of this recession, and that we are also fighting to care for the poor, the elderly, the afflicted," Carter said.

The president spoke to the national convocation of Opportunities Industrialization Centers of America, a private, job-training and job-placement organization meeting at the Fontainebleau Hotel.

The growing controversy over administration economic policy was clearly evident in the contrast between Carter's generally optimistic speech and remarks by Rep. Cardiss Collins (D-ILL.) and other members of the Congressional Black Caucus after they met with the president at the White House this morning.

While Carter described the recession as "the almost inevitable" result of rising world oil prices, Collins blamed administration economic policy, which she said is causing "a great deal of distress -- financially, economically, spiritually."

To fight the near 20 percent inflation that hit the country eariler this year, Carter proposed balancing the federal budget, partly by cutting domestic spending. Blacks and others complained then that he was fighting inflation mainly at their expense. Now unemployment has jumped to 7.8 percent, inflation is falling, and the calls for a policy switch have intensified.

Another caucus member, Rep. Augustus F. Hawkins (D-Calif,), said today the group had demanded "more jobs" and an end to "the policy of trading jobs in the vain hope that this will solve inflation."

Carter is to study the caucus proposals and meet with the group again in about two weeks, after which, Collins said, in an implicit political threat, "we will be able to make some kind of statement as to the politics that are going to take place in November of this year."

"We have come away with a feeling of real disappointment -- disappointment because, first of all, we felt that there were two ships passing in the night," she added. "The president, I don't think, fully understood the intensity of the situation that we find in all of our districts."

While Collins threatened politcal retaliation in the fall, a member of the caucus, who asked not to be identified, conceded that it will be difficult for the black legislators not to support Carter against the likely Republican nominee, Ronald Reagan, no matter how unhappy they are with the president's economic policies.

Carter's speech in Miami Beach had many of the elements of a campaign address, including his recently unveiled theme that the country has begun to "turn the tide" against its principal economic and energy problems.

Defending the asutere spending proposals he has sent to Congress in an attempt to reduce the inflation rate, Carter asserted that his is "a budget of compassion" that does not overlook the needs of the elderly, the disabled or dependent children.

"I call on you to keep the faith," he said. "We will not waver in our struggle to build an economy that sustains the hopes and dreams of the forgotten people of our country."

The president announced an agreement to use the Opportunities Industralization Centers to place 100,000 young graduates of federal job-training programs in permanent jobs during the next year. But while conceding that "there are still hard times for millions of Americans," he made no announcement of changes in economic policy.

At the end of his Miami Beach speech, Carter mentioned the Miami riots of May 17.

"Despite the progress we have made, the recent tragedy in Miami is a reminder that we still have far to go," he said.

"I am saddened that those most hurt by the rioting here are those who already had the least. Burning down a business cannot create any jobs. Violence cannot breed justice. Hate can only poison and ultimately destroy our hopes for the future. Our Constitution calls on the national government to establish justice -- including social justice -- and also to ensure domestic tranquility. I am committed to doing both."

Carter left Miami tonight en route to Seattle, where on Tuesday he is to receive a report on progress in recovering from the eruption of Mount St. Helens and deliver a speech to the annual meeting of the U.S. Conference of Mayors. He is scheduled to stop briefly in Grand Island, Neb., on his return to Washington Tuesday afternoon to inspect tornado damage.